Sitemap
HackerNoon.com

Elijah McClain, George Floyd, Eric Garner, Breonna Taylor, Ahmaud Arbery, Michael Brown, Oscar Grant, Atatiana Jefferson, Tamir Rice, Bettie Jones, Botham Jean

Member-only story

5 Techniques to Iterate Over JavaScript Object Entries and their Performance

2 min readJun 26, 2018

--

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.

Technique 3 : Object.values

--

--

HackerNoon.com
HackerNoon.com

Published in HackerNoon.com

Elijah McClain, George Floyd, Eric Garner, Breonna Taylor, Ahmaud Arbery, Michael Brown, Oscar Grant, Atatiana Jefferson, Tamir Rice, Bettie Jones, Botham Jean

Chathura Widanage
Chathura Widanage

Written by Chathura Widanage

Digital Science Center - Indiana University

Responses (9)