Click here to Skip to main content
15,617,231 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
var score = 40
score 5;

What I have tried:

I have put assignment operators (+, -, and /) in the space between score and 5 as written above but I got wrong results.
Updated yesterday
Dave Kreskowiak 14-Jan-23 11:33am    
There is only one assignment operator, =

You haven't said what this little piece of code is supposed to do, so it's impossible to tell you what you're doing wrong.

See JavaScript Operators[^] for all the details.
Share this answer
You need to actually use an assignment operator to change a value (or a "hidden assignment" such as a pre- or post- increment / decrement operator).
score = score - 5;
Share this answer
The answer is
Var score = 40;
Score -= 5;
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900