bracket notation javascript

JavaScript
var obj = {x: 5};
obj.x; // 5
obj["x"]; // 5

obj.A-B = 6; // Doesn't work
obj["A-B"] = 6; // Works!// Also useful for dynamic strings, e.g. `thing-${variable}`
myObject['thing'] = true;
Source

Also in JavaScript: