// object
let obj = { name: 'Joe' };
// โญ๏ธ bracket notaton
// -------------------------------------------------------------------
// โข syntax: `obj [ prop ]`
// โข obj : expression (โ value of null/undefined raises TypeError)
// โข prop: expression (โ evaluated and "converted" to string)
// -------------------------------------------------------------------
obj[''] = 'joe'; // โ
"empty string" is OK
obj[' '] = 'OK'; // โ
"space" is OK
obj[true] = true; // โ
boolean is OK
const key = "name"; // variable
const getKey = () => "name"; // function
// โญ๏ธ `prop` can be any expression.
obj["name"], // 'Joe' (prop: string literal)
obj[key], // 'Joe' (prop: variable)
obj[getKey()], // 'Joe' (prop: function return value)