+ 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!

16th Mar 2016, 1:12 PM
Malachi Jones
Malachi Jones - avatar
7 Answers
+ 2
Missing a + after number and before "="
3rd Mar 2016, 5:26 AM
Steven Wonchoba
Steven Wonchoba - avatar
+ 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);
15th Jun 2016, 10:18 PM
Jeremiah
Jeremiah - avatar
+ 2
You forgot + after number and before " = " & it should be as below. var sum = "5 multiplied by " + number + " = " + myFun(5, number);
15th Nov 2016, 7:58 PM
Vishnu Damwala
Vishnu Damwala - avatar
+ 1
You are just missing a "+" between "number" and ' "=" '. The others are good to go.
6th Mar 2016, 5:38 AM
HongweiChen
+ 1
You forget about + between number and "="
21st Mar 2016, 3:01 PM
Wojciech Kasperski
Wojciech Kasperski - avatar
+ 1
put a + after number and before "="
12th Sep 2016, 3:06 AM
roshan regmi
roshan regmi - avatar
0
??
22nd Jun 2016, 3:41 PM
Sudhir Dilip Salunkhe
Sudhir Dilip Salunkhe - avatar