Tag

for...in

0 views collected around this technical thread.

WeDoctor Frontend Technology
WeDoctor Frontend Technology
Jul 21, 2021 · Frontend Development

7 JavaScript Object Traversal Techniques Illustrated with Allen Iverson

This article examines seven ways to iterate over JavaScript objects—excluding arrays, Map, and Set—using a sample player object modeled after Allen Iverson, detailing each method’s handling of own, inherited, enumerable, non‑enumerable, and Symbol properties, with code examples and output analysis.

JavaScriptObject TraversalObject.keys
0 likes · 9 min read
7 JavaScript Object Traversal Techniques Illustrated with Allen Iverson
Vipshop Quality Engineering
Vipshop Quality Engineering
Aug 8, 2017 · Frontend Development

Why for…in Breaks JavaScript Arrays and How for…of Fixes It

This article examines a production incident caused by using the ES5 for...in loop to iterate over arrays, explains its pitfalls such as prototype pollution and string indexes, and demonstrates why switching to the ES6 for...of construct provides safer, more predictable array traversal.

ES6JavaScriptPrototype
0 likes · 6 min read
Why for…in Breaks JavaScript Arrays and How for…of Fixes It