Do you know what will be the output of this code?
JavaScript
const obj = {};
obj[1] = "a";
obj["1"] = "b";
console.log(obj[1]);
Show answer and explanation
The answer is "b".
Plain object keys are converted to strings. obj[1] and obj["1"] are the same property, so the second assignment overwrites the first. A Map keeps them separate.