Possible Duplicate:
What is the difference between object keys with quotes and without quotes?
Is interest, what is right way, write object keys in quotes or not? that is
var obj = {
"name": "Jhon"
}
or
var obj = {
name: "Jhon"
}
for example, from php code echo json_encode(array("a"=>"aaa","b"=>"bbb"));
result is object who has keys with quotes.
But for example see jquery animate, in documentation is keys without quotes, (This is also JS object format, right?)
$("#someElement").animate({
marginLeft: "200px"
},
{
duration: 1000
});
So, what is more right way?