Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Create a Sum Function | Functions in JavaScript
Introduction to JavaScript (copy with unittests)

bookChallenge: Create a Sum Function

Task

Swipe to start coding

Implement a function sum that takes three arguments (a, b, and c) and returns their sum.

Next, call this function twice, using the following sets of arguments:

  1. Use 24, 12, and 32 for the first function call and store the result in the variable sum1.
  2. Use 12, 42, and 5 for the second function call and store the result in the variable sum2.

Finally, print the results of both function calls.

The output should be:

sum1 = 68
sum2 = 59

Solution

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 6. ChapterΒ 6
single

single

Ask AI

expand

Ask AI

ChatGPT

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

close

Awesome!

Completion rate improved to 2.5

bookChallenge: Create a Sum Function

Swipe to show menu

Task

Swipe to start coding

Implement a function sum that takes three arguments (a, b, and c) and returns their sum.

Next, call this function twice, using the following sets of arguments:

  1. Use 24, 12, and 32 for the first function call and store the result in the variable sum1.
  2. Use 12, 42, and 5 for the second function call and store the result in the variable sum2.

Finally, print the results of both function calls.

The output should be:

sum1 = 68
sum2 = 59

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Β 6. ChapterΒ 6
single

single

some-alt