I've seen people use code that looks like
const STUFF_MAP = Object.create(null);
STUFF_MAP
would like suggested only be used like a map, so I understand why using Object.create(null)
is better than {}
(removing the properties that could cause conflicts etc.), but is there any advantage to not just use
const STUFF_MAP = new Map();
When would I use each one? Does it have to do with being compiled to pre es6?