Possible Duplicate:
JavaScript BlockStatement confusion
Why does {10 + '1'} + 10 equal 10?
I’m guessing the 1 doesn’t work because its in a string but not sure about the rest.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This:
is a statement block. It’s not equal to 10; it has
no value at all in factthe value “101”, a string (learn something useless every day :-). It is not, in particular, an object.This:
is equal to 10.
Try this:
and you’ll see a difference.