Hey yall!
So no video for this week but that's just because there was a lot going on between a wedding from some friends with college, a trip to philly to celebrate another friend's birthday and just...well there really wasn't a coding assignment for this week?
This week at the bootcamp we went over how to handle simple loops and conditionals!
I've worked with JS and TS for awhile now so just to summarize what we went over:
Conditionals
Conditionals are the most basic form of logic in a program, I like to think of them like a series of on off switches inside the program. You basically set up an if statement and if the condition you hand it resolves to true then the code block that is within the curly braces that follows is run. Otherwise the code is skipped, and if there is a else condition then that code is run instead! Basically if the condition is true then the turns on, and if its false then it's left off!
Here's a snippet of kinda what that looks like in JS!
Loops
Loops are the basic way that we can use to repeat a logical block of code either using an incrementing counter or by mapping over a specific data structure!
There are tons of different flavors of loops, like the standard for loop, the for...of loop, the for..in loop, the do..while loop, and the numerous array methods that let us loop through an array! I like to picture it like that old Dj Kahled video "ANOTHER ONE." over and over on straight repeat (at least until the counter is up!
Here's a snippet of some basic for loops:
Also dang it Little Timmy! Get out of the well!
You'll be using conditionals and loops just a TON in your career so these are those fundamental building blocks you're gonna want to spend extra time on!
Anyways, till next time!
Onwards and upwards
-Travis