+ 1
what is the use of ' text"" ' and 'text i'
what is the use of ' text"" ' and 'text i' in the given code:- for (i=1, text=""; i<=5; i++) { text = i; document.write(i + "<br />"); }
1 Answer
+ 1
In my opinion there is no use, unless I am missing something or your code snippet is missing some context. The iteration variable i is being assigned to text, but not used. Omitting the text in the loop declaration and loop execution gives the same output.