3 ms·
5 Techniques to iterate over JavaScript object entries – performance comparison
- winrid 7y agoFor-in wins partly because some of the solutions are allocating a second collection before iterating, along with function calls for each iteration...
- notsag-hn 7y agoFor some reason I thought using Object.keys was the way to go. For .. in just looks horrible :D
- cwidanage 7y agoObject.keys + traditional forloop performs better than for..in. Updated the article.