Okay, recently for class, we ran into the following problem:
When we entered in
var x=1
eval(x + "2*2")
and had it returned and printed to the screen, we came out with 24 as the result. This defies all logic that we can think of, and so we decided to ask for help. When each section is done individually within the eval function, we get x is the value of 1, 2*2 is the value of 4, but when they are added, it always comes out as 24. Anybody out there know why?
When we entered in
var x=1
eval(x + "2*2")
and had it returned and printed to the screen, we came out with 24 as the result. This defies all logic that we can think of, and so we decided to ask for help. When each section is done individually within the eval function, we get x is the value of 1, 2*2 is the value of 4, but when they are added, it always comes out as 24. Anybody out there know why?
Comment