Mastering Shorthand
Easy+20 XP
Mission Briefing
The arena scoreboard is manually operated, and the scorekeepers are exhausting themselves writing score = score + 10. You must implement a faster shorthand system!
The Concept: Assignment Operators
When we want to update an existing variable, JavaScript provides "Shorthand" assignment operators to make our code cleaner:
x += 5(Add 5 to current x)x -= 2(Subtract 2 from current x)x++(Increment exactly by 1)
The Objective
Your function receives a starting score.
- Add 10 to the score using the
+=shorthand. - Increment the result by 1 using the
++shorthand. - Return the final updated score.
01EXAMPLE 1
Input
score = 100Output
111Explanation: 100 + 10 = 110, then 110 + 1 = 111
02EXAMPLE 2
Input
score = 0Output
11Explanation: 0 + 10 = 10, then 10 + 1 = 11
Constraints
- Use shorthand operators to perform the updates.
FundamentalsVariablesUpdates
JavaScriptSystem handles I/O — write your function only
Loading...
3 Hidden
Input Arguments
score100
Expected Output
111
Click RUN to test your solution