Member-only story
5 Techniques to Iterate Over JavaScript Object Entries and their Performance
This post includes 5 different ways for iterating over JavaScript Object entries and a performance comparison of those techniques.
Technique 1 : Object.entries
Object.entries() returns a list of key, value pairs. This list includes only enumerable properties and doesn’t include properties from prototype chain.
Enumerable Properties?
Properties created via simple assignment or via a property initializer
Technique 2 : Object.keys
Object.keys() returns an array of object keys. However, this function returns only enumerable properties.