- Use
if / else if / ifto write conditional code - Identify the syntax of standard
forloops - Write
forloops - Write
whileloops - Loop over an array
- Loop over an object
-
What will the following code snippets print out?
if (2 > 1) { console.log('A'); } else { console.log('B'); }
Your answer...
if (2 > 1 && 5 <= 3) { console.log('C'); } else { console.log('D'); }
Your answer...
if (7 % 2 === 0 || Number.isInteger(3.4)) { console.log('E'); } else if (6 <= Math.floor(5.8)) { console.log('F'); } else { console.log('G'); }
Your answer...
Complete the challenges in this lesson: https://learn.galvanize.com/cohorts/650/units/7294/content_files/82809
-
What is a for loop used for in javascript?
Your answer...
-
Looking at the following example, idetify the 5 main parts of the for loop:
1. keyword 2. initial step 3. condition 4. increment step 5. bodyfor(var i = 0; i < 5; i++) { console.log(i) }
Your answer...
-
What is a while loop used for in javascript? When would you use a while loop instead of a for loop?
Your answer...
Complete the challenges in this lesson: https://learn.galvanize.com/cohorts/650/units/7294/content_files/82807
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Control_flow_and_error_handling https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Loops_and_iteration