Course Content
Introduction to JavaScript
4. Conditional Statements
Introduction to JavaScript
Challenge: Sum
Task
- Implement a function
sum
that takes 3 arguments (a
,b
, andc
) and returns the sum. - Call this function twice and save the results to the variables
sum1
andsum2
.
The output should be:
Use arguments 24
, 12
, and 32
for the first function call.
Use arguments 12
, 42
, and 5
for the second function call.
- Use the
return
keyword inside the function body. - Use the function name to call this function.
- Choose values yourself.
Everything was clear?
Section 6. Chapter 6
Course Content
Introduction to JavaScript
4. Conditional Statements
Introduction to JavaScript
Challenge: Sum
Task
- Implement a function
sum
that takes 3 arguments (a
,b
, andc
) and returns the sum. - Call this function twice and save the results to the variables
sum1
andsum2
.
The output should be:
Use arguments 24
, 12
, and 32
for the first function call.
Use arguments 12
, 42
, and 5
for the second function call.
- Use the
return
keyword inside the function body. - Use the function name to call this function.
- Choose values yourself.
Everything was clear?
Section 6. Chapter 6