+ 3
for (i=1; i<=5; i++) { document.write(i + "<br />"); } why should used for + symbol inside the parentheses...lemma explain
JavaScript
3 RĂ©ponses
+ 3
i and <br> are two separate things, so of you write them two like this: i<br>
It won't understand what you mean by it and it won't recognise the i in i<br> as a number either, so you should write them apart with a + sign. That means it'll write i with <br> right after it
+ 3
this is one of the reasons I use ES6 template string, backticks (``). The example above could just be:
document.write(`${i}</br>`)
+ 1
Concept of operator overloading.
In some languages + is used for string concatenation.