en.javascript.info/1-js/02-first-steps/12-while-for/2-which-value-while/task.md
Ilya Kantor 0fcf9f84fa fixes
2017-03-24 17:28:37 +03:00

379 B

importance: 4


Which values shows the while?

For every loop, write down which values it shows, in your opinion. And then compare with the answer.

Both loops alert same values or not?

  1. The prefix form ++i:

    let i = 0;
    while (++i < 5) alert( i );
    
  2. The postfix form i++

    let i = 0;
    while (i++ < 5) alert( i );