reading-notes

Class 08

Thursday Afternoon June 29th 2023

Notes

Q&A’s

Questions

  1. What is an expression in JavaScript?
  2. Why would we use a loop in our code?
  3. When does a for loop stop executing?
  4. How many times will a while loop execute?

Answers

  1. A piece of code that produces a value, such as a variable, a function call, or a mathematical operation.
  2. Use loops in code to repeat a set of instructions multiple times, saving time and reducing repetitive code.
  3. A for loop stops executing when the specified condition becomes false or when there are no more iterations left.
  4. A while loop will continue executing as long as the specified condition remains true, potentially running indefinitely if the condition is not met.