Thursday , September 19 2024

Examine the following code: for (let a = 5; a > 1; a–) { console.log(a); } ; Which statement can replace the for from the example above?

Questions BankCategory: JavaScript Essentials 1Examine the following code: for (let a = 5; a > 1; a–) { console.log(a); } ; Which statement can replace the for from the example above?
Examine the following code:

for (let a = 5; a > 1; a--) {
    console.log(a);
}
;

Which statement can replace the for from the example above?

  • let a = 1; while (a < 5) console.log(a++);
  • let a = 5; while (a > 1) console.log(a++);
  • let a = 6; while (a >= 1) console.log(a--);
  • let a = 5; while (a > 1) console.log(a--);

More Questions: JavaScript Essentials 1 – JSE1: Module 4 Test