Question: Consider the JavaScript code segment below. function mystery ( num 1 , num 2 ) { var total = 0 for ( var i =

Consider the JavaScript code segment below.
function mystery(num1, num2){
var total =0
for (var i =0; 1< num1; i++){
total = total + num2;
}
return total;
}
document.write(mystery(2,3)+"
");
document.write(mystery(4,5)+"
");
a. What will be displayed by document.write(mystery(2,3)+"
"); ?
b. What will be displayed by document.write(mystery(4,5)+"
"); ?
c. Briefly explain the purpose of the function mystery.
LABEL YOUR ANSWERS a, b, and c.

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 Databases Questions!