This is what it says:
You can use an incrementer to make a number increase by one or a
decrementer to make it decrease by one. To increase the number, you
can use ++ after a variable.Let’s make the variable i, in the editor, equal to 2 by incrementing
it twice. This should involve two separate lines with i++; on them.
Try it out now.Here you can have two separate lines of iteration. Each should contain
just i++.
I have to modify this code:
var i = 0;
print( "i is equal to " + i );
I’m not sure if I’m too dumb, but I don’t know how to complete this tutorial.
The answer is trivially:
Advanced details follow:
For what it’s worth, my preference would be to use the pre-incrementing
++ioperator rather than post-incrementingi++.The reason for this is that strictly speaking the latter evaluates to the original value of
ias it was before it was incremented, i.e as if it was a function that does this:This doesn’t really matter in Javascript, but if you progress to more advanced languages such as C++ it matters, because taking that additional copy of the object can be expensive.