reading-notes

Answering questions

  1. What is an expression in JavaScript? An expression in JavaScript is a piece of code that produces a value. Expression can be as simple as asingle constant or as complex as a combination of variable, operator, and function calls.

  2. Why would we use a loop in our code? loops are a fundamental building block of programming and are essential for making your code more efficient, concise, and flexible. They enable you to perform a wide range of tasks and solve various problems in software development.

  3. When does a for loop stop executing? A for loop in JavaScript stops executing when the condition specified in the loop header becomes false.

  4. How many times will a while loop execute? The number of times a while loop will execute depends on the condition specified in the loop. A while loop will keep executing as long as the condition is true. When the condition becomes false, the loop stops.