Learn JavaScript on the Now Platform: Lesson 16 - The for loop

preview_player
Показать описание
This lesson explains and demonstrates how to use the for loop to run one or more statements multiple times.

Рекомендации по теме
Комментарии
Автор

thank you for the 'var' info its saved my script

fatimaezzahramountacer
Автор

Magnificently strange stuff, lol XD
You're amazing speaker, Chuck, thanks for the course!

ConstSyr
Автор

Hi Chuck . You have said when i ==5 it makes 6 times. (2.min 50s). I have checked that . It's brake immediately.

welnamarcin
Автор

Question for anyone; why doe the last gs.info(i) display 5 and not 10? I thought the for loop i would be in a different scope than the first i.
Code:
var i = 10;

for (var i = 0; i < 5; i++) {
gs.info(i);
}

gs.info(i);

Output:

*** Script: 0
*** Script: 1
*** Script: 2
*** Script: 3
*** Script: 4
*** Script: 5

Thanks for your help.

davejohnson
welcome to shbcf.ru