A Simple Explanation of Scope in JavaScript
A clear guide explaining how variable scope works in JavaScript, covering block, function, module, and global scopes.
Dmitri Pavlutin is a Senior Frontend Developer with 10+ years of experience, specializing in JavaScript, TypeScript, React, and Vue.js. He shares practical tutorials and insights on modern frontend development, UI/UX, and application architecture.
176 articles from this blog
A clear guide explaining how variable scope works in JavaScript, covering block, function, module, and global scopes.
Explains how JavaScript's && and || operators work with truthy/falsy values, not just booleans.
The article discusses a drawback of JavaScript's ES2015 module import syntax regarding IDE autocomplete and compares it to Python's approach.
Explores the versatility and benefits of the JavaScript for...of loop, including array iteration, destructuring, and array-like object handling.
A guide to advanced console.log() techniques in JavaScript for better debugging, including formatting, styling, and interactive logs.
Explains how JavaScript ES2015 modules handle multiple imports, ensuring a module is evaluated only once.
Three essential rules for designing and managing state effectively in React functional components, focusing on single responsibility and complexity extraction.
Learn 4 essential best practices for writing clean, maintainable, and efficient JavaScript modules, including export strategies and import behavior.
Explores four methods to swap variable values in JavaScript, including destructuring, temporary variables, and arithmetic operations.
A tutorial on setting up a local React development environment with zero configuration using the Parcel bundler in three simple steps.
Explains three methods to access object properties in JavaScript: dot notation, bracket notation, and object destructuring.
Learn 5 essential best practices for writing clean and effective arrow functions in JavaScript, including naming and formatting tips.
A guide to using JavaScript template strings (template literals) for string interpolation, including syntax, placeholders, and best practices.
Advocates for explicit coding discipline, focusing on clear naming and communication to improve code readability and prevent misunderstandings.
An in-depth look at the NaN (Not a Number) value in JavaScript, covering its nature, how to check for it, and common operations that produce it.
A guide on effectively using JavaScript utility libraries like Lodash and Date-fns, focusing on performance, bundle size, and best practices.
Learn three methods to replace all instances of a substring in JavaScript: split/join, replace() with regex, and replaceAll().
Explains the properties, behavior, and common pitfalls of the special Infinity and -Infinity numbers in JavaScript.
A comprehensive guide to JavaScript classes, covering syntax, fields, methods, inheritance, and how they work with prototypal inheritance.
Explains the confusing edge cases and pitfalls of JavaScript's typeof and instanceof operators for type checking, with practical workarounds.