Question: In this lab, you will learn how to declare a function, pass values to this function, and return values from the function. In the JavaScript

In this lab, you will learn how to declare a function, pass values to this function, and return values from the function.
In the JavaScript block, perform the following tasks:
Create a function named sum and pass the parameters a and b to it.
Create a variable c and store the sum of the parameters a and b in it.
Return the result, that is, c.
Sample input:
Copy
sum(60,40)
Sample output:
Copy
100

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!