0
Setting var "i" to the result?
So I was experimenting with JS and encountered a problem. I added a multiply button that will multiply the current number by whatever number you input. But it doesn't set the variable to the result. It just displays the result. How can I set variable i to the result rather than just display the result? https://code.sololearn.com/WvE088j7E2Ka/?ref=app
4 Answers
+ 1
Try adding this line in multiply function-
i = i *p;
+ 1
Thank you. It worked.
0
This question is very poorly written. To understand what I mean, try multiplying any number. Then try adding or subtracting 1.
0
đ