Wondering if a given character sequence can be used as an unquoted property name in JavaScript? Can dot notation be used to get or set this property based on its name? Read all about it, or just use this tool.
You don’t need to quote this property name for backwards compatibility with ES5 for backwards compatibility with ES3: permalink
var object = {
foo-bar: 42
};
You can’t use dot notation here:
object.foo-bar = 42;