I’ve just discovered that you can do:

const obj = {[undefined]: 42};
obj.undefined; // 42
obj[undefined]; // 42

but unfortunately you cannot do:

obj[someUndefinedVar]; // ReferenceError: someUndefinedVar is not defined

It’d have been nice to have map-like objects providing a default value…