+ 1
I seriously don't know why the output is 24 and not 14 any idea ? var a="1"; var b="2*2"; console.log(eval(a+b));
Javascript challenge question
2 Réponses
+ 6
a + b ==
"1" + "2*2" ==
"12*2"
Keep in mind that before doing `eval`, you are adding strings, not numbers.
0
Schindlabua thanks