For javascript object, for its property, I usually do not add a single quote to it. I remember if I add a single quote to an object' property, it will become a JSON? am I right?
Please see this code, both code will output object's value. Please explain do I need to add a single quote to a object's property?
var test1 = {
foo: 'foo1',
bar: 'bar1'
};
alert(test1.foo);
var test2 = {
'foo': 'foo1',
'bar': 'bar1'
};
alert(test2.foo);