Is there any difference between the following?:
var object1= {
a: 0,
b: 1,
c: 2
};
vs
var object2= {
'a': 0,
'b': 1,
'c': 2
};
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.
There’s no difference in your example. There would be a difference if you wanted your property names to be a number or have spaces (both of which are valid, but strange).
If you have two minutes you might find this page VERY helpful.
http://bonsaiden.github.com/JavaScript-Garden/#object.general