0
Answer javascript
What alert will display on the screen? function test(a, b) { if(a > b) { return a*b; } else { return b / a; } } alert(test(5, 15)); What alert will display on the screen?
7 Answers
+ 5
here is the answer
function test()
{
/* some code */
}
+ 4
What alert will display on the screen?
function test(a, b) {
if(a > b) {
return a*b;
} else {
return b / a;
}
}
alert(test(5, 15));
/ number alerted 15/5 = 3
}
}
alert(test(5, 15));
// called the function "test" by value
so the answers will be "3"
+ 1
3
0
Here is the explanation :
// Global function declaration
function test(a, b) {
if(a > b) {
// if a is greater than b
return a*b;
// number alerted 5*15 = 75
} else {
// if a is smaller than b or equal to b
return b / a;
// number alerted 15/5 = 3
}
}
alert(test(5, 15));
// called the function "test" by value
0
ty boi
0
else
0
if
a
else