all right, it’s far easier showing some code…
Is there any performance or any other kind of difference between this javascript code
var obj = {
'id': 0,
'name': 'new obj'
};
and
var obj = {
id: 0,
name: 'new obj'
};
(Have a look at the single quotes surrounding id and name)
—
If I recall correctly, in php it was adviced to always use the single quotes, because if not the interpreter had to check if there existed a variable with that name…
no performance difference i believe.
Usually we use quotes to use reserved words in JavaScript like
class, which is not allowed to be used as an object key.