2 ms·
This is just a contrived example. In this situation there are a small number of keys that are all known in advance, which is exactly what object literals are fo
by shawnz 12y ago
This is just a contrived example. In this situation there are a small number of keys that are all known in advance, which is exactly what object literals are for. A map would be more appropriate in situations where you have a large number of keys that are built up at runtime. Similarly, it is the latter situation where the ability to enumerate is important.