Nalini1998 / Project_Public

MIT License
2 stars 0 forks source link

What is incorrect about the code block? #549

Closed Nalini1998 closed 1 year ago

Nalini1998 commented 1 year ago

What is incorrect about the code block?

  for (let i = 0, i < myArray.length,  i++) {
    console.log(myArray[i]);
  };

A. let is not needed for the start condition.

B. i++ should be i = i + 1.

C. The for loop expressions are out of order.

D. The condition of the loop should be separated by semicolons, not commas.

Nalini1998 commented 1 year ago

I chose D. The condition of the loop should be separated by semicolons, not commas.