+ 2
Can anybody tell me why the below doesn't work in the code playground part of this app please?
function myFun(a,b){ var c = a*b; return c; } var number = prompt("Please enter a number"); var sum = "5 multiplied by " + number " = " + myFun(5, number); alert(sum); Thanks in advance!
7 Answers
+ 2
Missing a + after number and before "="
+ 2
your code should look like this:
function myFun(a,b){
var c = a*b;
return c;
}
var number = prompt("Please enter a number");
var sum = "5 multiplied by " + number + " = " + myFun(5, number);
alert(sum);
+ 2
You forgot + after number and before " = " & it should be as below.
var sum = "5 multiplied by " + number + " = " + myFun(5, number);
+ 1
You are just missing a "+" between "number" and ' "=" '.
The others are good to go.
+ 1
You forget about + between number and "="
+ 1
put a + after number and before "="
0
??