Tagged articles
6 articles
Page 1 of 1
JavaScript
JavaScript
Jun 16, 2025 · Frontend Development

5 Hidden JavaScript Pitfalls That Can Break Your Code

This article uncovers five subtle JavaScript pitfalls—including async/await errors, Promise.all fail‑fast behavior, array mutation during iteration, closure‑induced memory leaks, and shallow versus deep copying—providing clear examples and best‑practice solutions to write more robust, predictable code.

JavaScriptPromisearray iteration
0 likes · 10 min read
5 Hidden JavaScript Pitfalls That Can Break Your Code
JavaScript
JavaScript
Apr 24, 2025 · Frontend Development

Why for...in Loops Can Break Your JavaScript Arrays and Safer Alternatives

The article explains that JavaScript’s for...in loop, intended for object property enumeration, can produce unordered results, traverse custom and prototype properties, and cause performance and bug issues when used on arrays, and it recommends safer alternatives such as classic for loops, for…of, forEach, and functional methods.

JavaScriptarray iterationbest practices
0 likes · 4 min read
Why for...in Loops Can Break Your JavaScript Arrays and Safer Alternatives
政采云技术
政采云技术
May 25, 2021 · Frontend Development

A Comprehensive Guide to JavaScript Array and Object Iteration Methods

This article provides a comprehensive comparison of common JavaScript iteration methods for arrays and objects, including for, forEach, for...of, map, filter, reduce, and Object.keys, detailing their syntax, performance characteristics, termination behaviors, and practical use cases to help developers choose the most efficient approach.

ES6 Featuresarray iterationfrontend engineering
0 likes · 12 min read
A Comprehensive Guide to JavaScript Array and Object Iteration Methods
php Courses
php Courses
Mar 19, 2021 · Backend Development

Understanding PHP foreach Loop Syntax and Usage

This tutorial explains PHP's foreach loop syntax, illustrating how to iterate over arrays with value-only and key‑value formats, and how to traverse object properties, accompanied by complete code examples for each case.

Backend Developmentarray iterationforeach
0 likes · 2 min read
Understanding PHP foreach Loop Syntax and Usage
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.

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