参见英文答案 >
What is the difference between object keys with quotes and without quotes?6
引用和未引用的JavaScript对象属性/方法名称之间有区别吗?
引用和未引用的JavaScript对象属性/方法名称之间有区别吗?
例如,这两者有什么区别?
var obj1 ={ property1 : "Value 1",method1 : function() { return true; } }; var obj2 = { "property1" : "Value 1","method1" : function() { return true; } };