+ 1
Please help
Can somebody please break this down for me, what the mathematical process is of the following var x = “2*2” var y= 4 var z = eval(x+y) alert(z)
3 Antworten
+ 2
// Because you make the 1st variable with a string and he can not make the operation.
But if you use int, JavaScript can make the operation as a calculator.
+ 4
hi Luke Sandford
ok so x is a string value
then y is an int value
z evaluates to a string because it is the first value so the output is 2*24
i hope this helps
+ 2
thanks guys