+ 3

Console & eval

Hi everyone, please why is the answer of this 24? var a= "1"; var b= "2*2"; console.log(eval(a+b));

26th Oct 2021, 5:41 AM
Okonte Richard-Koko
Okonte Richard-Koko  - avatar
3 Réponses
+ 3
Thanks a lot guys for breaking it down. I really appreciate it and i understand it now.🤗
26th Oct 2021, 8:30 AM
Okonte Richard-Koko
Okonte Richard-Koko  - avatar
+ 1
a+b = 1(2*2) = 12*2 = 24
26th Oct 2021, 6:02 AM
Kashyap Kumar
Kashyap Kumar - avatar