Course Content
Introduction to JavaScript
Introduction to JavaScript
Challenge: Variable Operations
Task
- Create the variable
num
. - Assign the value
29
to the variablenum
. - Increase the
num
variable by 99. - Decrease the
num
variable by 23.
let num; num ___ 29; console.log(num); num ___ 99; console.log(num); num ___ 23; console.log(num);
The output should be:
- Assign values to the variable using the assignment operator (
=
). - Use arithmetic operators to perform calculations on the variable (
+=
and-=
).
let num; num = 29; console.log(num); num += 99; console.log(num); num -= 23; console.log(num);
Thanks for your feedback!