+ 1

var x="2*2"; var y=4; var z=eval(x+y); alert(z);

Ans is 48 how?

20th Apr 2021, 8:03 AM
Rohit Ahuja
Rohit Ahuja - avatar
2 Respuestas
+ 4
x+y = "2*2"+4 //String concatenation => "2*24" eval("2*24") = 48
20th Apr 2021, 8:11 AM
Vadivelan
0
Thnku so much
20th Apr 2021, 10:09 AM
Rohit Ahuja
Rohit Ahuja - avatar