Add and Subtract explainer

The aim of this puzzle: To add to and subtract from the variable value
Walkthrough of the solution: This puzzle demonstrates how the plus (+) and minus (-) operators can be used to update a variables value. In the initial code the number 0 is being added to y, and then subtracted from y. To solve this puzzle, change 0 to be at least 1.
Sample code solution:
(Tap below to reveal)

var y = 5;
y = y + 5;
print('y is ' + y);
y = y - 3;
print('y is now ' + y);

JavaScript Concepts: Binary Expression (=, +, -), Calling Functions, Identifiers, Variable Declaration
Grasshopper Concepts: print()

3 Likes

Is this right?

1 Like

But it keeps showing me that I should press the reset button but I can’t find it

Hi Diwakar,

I don’t understand your code without seeing an error. Try posting an error that you got in your code.

Doge :smile: