© 2026 LinearBytes Inc.
Search posts, tags, users, and pages
Divine Orji
Software Engineer
Introduction A Map is a collection of elements, where each element is stored as a key: value pair. By this definition, it can seem similar to an Object, but while a Map can accept any data type (both primitive values and objects) as its key, an Objec...
Ridwan Olanrewaju
React Developer
Excellent article. I should mention though, that an Object can have a number as a property key.
number
For Example:
const x = { 7: "tight" } // undefined x[7] // 'tight'
If the key is of type Number, it will be converted to a String. So the value of x['7'] is also 'tight'.
Fecharalua
Fecharalua's correct. JavaScript will convert an Object's key to a string.
Héctor Ramírez
Linux Senior Consultant
As a constant learner I never miss an opportunity to increase my knowledge. Your article helped me expand my experience and be better prepared for future problem solving.
Glad to have helped! Héctor Ramírez
Idris Abdul-Lateef
Writer | Software Engineer
Brilliant article! 👏
Thanks Abdul!
Ridwan Olanrewaju
React Developer
Excellent article. I should mention though, that an Object can have a
numberas a property key.For Example:
const x = { 7: "tight" } // undefined x[7] // 'tight'