Challenge: Variable Operations Practice
Task
- Create the variable
num
. - Assign the value
29
to the variablenum
. - Increase the
num
variable by 99. - Decrease the
num
variable by 23.
123456789let num; num ___ 29; console.log(num); num ___ 99; console.log(num); num ___ 23; console.log(num);
The output should be:
29
128
105
- Assign values to the variable using the assignment operator (
=
). - Use arithmetic operators to perform calculations on the variable (
+=
and-=
).
123456789let num; num = 29; console.log(num); num += 99; console.log(num); num -= 23; console.log(num);
¿Todo estuvo claro?
¡Gracias por tus comentarios!
Sección 3. Capítulo 5
Pregunte a AI
Pregunte a AI
Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla
Suggested prompts:
Can you explain what the `+=` and `-=` operators do in JavaScript?
What would happen if I used `num = num + 99;` instead of `num += 99;`?
Can you show me how to do similar operations with another variable?
Awesome!
Completion rate improved to 2.33
Challenge: Variable Operations Practice
Desliza para mostrar el menú
Task
- Create the variable
num
. - Assign the value
29
to the variablenum
. - Increase the
num
variable by 99. - Decrease the
num
variable by 23.
123456789let num; num ___ 29; console.log(num); num ___ 99; console.log(num); num ___ 23; console.log(num);
The output should be:
29
128
105
- Assign values to the variable using the assignment operator (
=
). - Use arithmetic operators to perform calculations on the variable (
+=
and-=
).
123456789let num; num = 29; console.log(num); num += 99; console.log(num); num -= 23; console.log(num);
¿Todo estuvo claro?
¡Gracias por tus comentarios!
Sección 3. Capítulo 5