Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Variable Operations Practice | Performing Operations in JavaScript
Quizzes & Challenges
Quizzes
Challenges
/
Introduction to JavaScript

bookChallenge: Variable Operations Practice

Task

Swipe to start coding

  1. Create a function named manipulateNum.
  2. Inside the function, create the variable num and assign it the value 29.
  3. Increase the num variable by 99.
  4. Decrease the num variable by 23.
  5. The function should return an array with the three intermediate values of num after each operation: [29, 128, 105].

Do not print the values. Only return them from the function as an array in the specified order.

Solution

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 3. ChapterΒ 5
single

single

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

close

bookChallenge: Variable Operations Practice

Swipe to show menu

Task

Swipe to start coding

  1. Create a function named manipulateNum.
  2. Inside the function, create the variable num and assign it the value 29.
  3. Increase the num variable by 99.
  4. Decrease the num variable by 23.
  5. The function should return an array with the three intermediate values of num after each operation: [29, 128, 105].

Do not print the values. Only return them from the function as an array in the specified order.

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 3. ChapterΒ 5
single

single

some-alt