0

About this for loop please help me understand

in this example "text" is useless because it's never printed on a page or console right? So what does text do? for (i=1, text=""; i<=5; i++) { text = i; document.write(i + "<br />"); }

18th Apr 2017, 10:58 PM
AceDev
1 ответ
+ 8
If "text" appears only in the code you displayed, you can remove it because it will not affect the code.
18th Apr 2017, 11:49 PM
Ulisses Cruz
Ulisses Cruz - avatar