var x="2*2"; var y=4; var z=eval(x+y); alert(z); | Sololearn: Learn to code for FREE!

+1

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

Ans is 48 how?

4/20/2021 8:03:12 AM

Rohit Ahuja

2 Answers

New Answer

+4

x+y = "2*2"+4 //String concatenation => "2*24" eval("2*24") = 48

0

Thnku so much