Tagged articles
13 articles
Page 1 of 1
FunTester
FunTester
Oct 17, 2025 · Fundamentals

Why Does var Print 2 Twice? Unraveling JavaScript’s Function Scope and Hoisting

This article explains why a JavaScript function using var prints “2” twice, by detailing var’s function scope, variable hoisting, the compilation and execution phases, and contrasting the behavior with let and const, while offering practical coding recommendations to avoid common pitfalls.

JavaScriptVarconst
0 likes · 9 min read
Why Does var Print 2 Twice? Unraveling JavaScript’s Function Scope and Hoisting
JavaScript
JavaScript
Jun 3, 2025 · Frontend Development

Why IIFEs Are Obsolete: Embrace Block Scope with let/const

This article explains how the traditional IIFE pattern, once essential for creating private scopes in JavaScript, has been superseded by modern block‑level scope using let and const, offering cleaner syntax, better performance, easier debugging, and seamless integration with ES6+ features.

IIFEJavaScriptblock scope
0 likes · 5 min read
Why IIFEs Are Obsolete: Embrace Block Scope with let/const
JavaScript
JavaScript
May 6, 2025 · Frontend Development

Why Sticking to ES5 Is Holding Your JavaScript Back – Modern Alternatives Explained

This article examines common ES5 JavaScript patterns—such as var declarations, mixed function definitions, callback hell, the arguments object, constructor‑based inheritance, string concatenation, and manual loops—and shows how modern ES6+ features like let/const, arrow functions, promises, rest parameters, classes, template literals, spread syntax, and array methods provide cleaner, safer, and more maintainable code.

Arrow FunctionsJavaScriptasync/await
0 likes · 8 min read
Why Sticking to ES5 Is Holding Your JavaScript Back – Modern Alternatives Explained
JavaScript
JavaScript
Mar 2, 2025 · Frontend Development

Why ‘var’ Is Dangerous and How let/const Solve Its Pitfalls

This article examines why the traditional JavaScript var keyword should be avoided, explains the subtle pitfalls of its function scope, hoisting, and global leakage, and highlights the essential, often overlooked features of let and const—including temporal dead zone, true block scope, and immutability nuances.

JavaScriptVarconst
0 likes · 8 min read
Why ‘var’ Is Dangerous and How let/const Solve Its Pitfalls
Java Tech Enthusiast
Java Tech Enthusiast
Sep 10, 2024 · Frontend Development

Prefer const over let in modern JavaScript/TypeScript

Modern JavaScript/TypeScript development should default to using const instead of let, because const enforces immutability, improves readability, and avoids bugs, while let is reserved only for truly mutable cases such as loop counters, with tools like ESLint’s prefer‑const rule helping enforce this practice.

TypeScriptbest practicesconst
0 likes · 7 min read
Prefer const over let in modern JavaScript/TypeScript
php Courses
php Courses
Jul 5, 2023 · Frontend Development

Understanding var, let, and const in JavaScript

This article explains the differences between JavaScript's var, let, and const declarations, covering their scopes, hoisting behavior, and mutability, and provides clear code examples for each. It also highlights how const variables can still be modified when they hold objects or arrays, helping developers choose the right keyword for reliable code.

JavaScriptVarconst
0 likes · 5 min read
Understanding var, let, and const in JavaScript
Tencent IMWeb Frontend Team
Tencent IMWeb Frontend Team
Sep 3, 2017 · Frontend Development

Why Does let Appear Not to Be Hoisted? Unraveling JavaScript’s Variable Lifecycle

This article chronicles the author’s two‑month journey of understanding JavaScript’s let declaration, exploring its block scope, temporal dead zone, per‑iteration bindings, and the nuanced differences from var and function hoisting, while debunking common misconceptions with code examples and spec references.

Variable Scopees6frontend
0 likes · 10 min read
Why Does let Appear Not to Be Hoisted? Unraveling JavaScript’s Variable Lifecycle
Baidu Intelligent Testing
Baidu Intelligent Testing
Aug 18, 2017 · Frontend Development

Practical Guide to ES6 Features and Performance Comparisons in Node.js

This article reviews the compatibility of various Node.js versions with ES6 features, explains key ES6 constructs such as let, const, template literals, default parameters, destructuring, and classes, and presents performance benchmarks comparing these features to their ES5 equivalents, concluding with practical recommendations for developers.

ClassJavaScriptNode.js
0 likes · 6 min read
Practical Guide to ES6 Features and Performance Comparisons in Node.js
Java High-Performance Architecture
Java High-Performance Architecture
Jun 10, 2017 · Frontend Development

Master 7 Essential ES6 Features in Just 30 Minutes

This concise guide introduces seven frequently used ES6 features—including let, const, arrow functions, default parameters, destructuring, object shorthand, and template literals—explaining each concept so you can grasp them in roughly half an hour.

Arrow FunctionsJavaScriptconst
0 likes · 1 min read
Master 7 Essential ES6 Features in Just 30 Minutes
Tencent IMWeb Frontend Team
Tencent IMWeb Frontend Team
May 25, 2017 · Frontend Development

Master Essential ES6 Features: Let/Const, Arrow Functions, Templates, and More

This article offers a practical guide to the most commonly used ES6 features—let/const, arrow functions, template literals, destructuring, default parameters, spread operator, object literals, and classes—explaining their syntax, behavior, and real‑world usage to help developers quickly master modern JavaScript.

Arrow FunctionsDestructuringTemplate literals
0 likes · 12 min read
Master Essential ES6 Features: Let/Const, Arrow Functions, Templates, and More