How do you iterate over an array in JavaScript?
Compare every way to loop over a JavaScript array: for...of, forEach, map, filter, reduce and for, with async patterns and common pitfalls.
466 posts about JavaScript: questions with answers, tutorials and articles, newest first.
Compare every way to loop over a JavaScript array: for...of, forEach, map, filter, reduce and for, with async patterns and common pitfalls.
Compare pop, shift, splice, filter and toSpliced for removing array elements in JavaScript, and learn why the delete operator leaves holes.
Learn push, unshift and splice for changing arrays in place, and spread, concat, toSpliced and with when you need a new array.
Array literals, Array.from, Array.of, spread and the Array constructor compared, with the sparse array pitfall and modern non-mutating methods.
Five ways to create an object in JavaScript, from the literal to classes and Object.create, with guidance on which to choose.
Objects store named key-value pairs and arrays store ordered lists. See how they differ in access, iteration, copying and type checks.
A declaration is hoisted with its body and always named, while an expression is a value created when execution reaches it. See examples and guidance.
A while loop checks first and may never run. A do-while loop runs once before checking. See examples and when to use each.
A for loop gives you break, continue and await control, while forEach is a callback method for simple side effects. See when to use each, with examples.
See how null and undefined behave differently in functions, objects, type coercion and TypeScript, and how to check for each one correctly.
== converts types before comparing, === does not. See the rules each operator follows, with examples, edge cases and practical advice.
`var` is function scoped and hoisted as undefined, while `let` is block scoped. Learn every difference with examples.
A JavaScript closure is a function that remembers the variables of the scope it was created in. See how closures enable private state, factories and callbacks.
Learn how JavaScript hoists var, let, const, classes and functions, why early access gives undefined or a ReferenceError, and how to avoid hoisting bugs.
Use const by default and let when a value changes. See how scope, hoisting and the temporal dead zone separate let and const from var.
JavaScript has eight data types: seven primitives and the object type. See each one with examples, typeof quirks and reliable type checks.
JavaScript is dynamically typed, prototype based and driven by an event loop. See how that compares with Java, C++ and Python, with short code examples.
Learn why JavaScript was created, what its purpose is in the browser and on servers, and which core features to learn first.

Common JavaScript interview questions with clear answers and examples: closures, hoisting, equality, classes, promises and modern syntax.

Build a React Async Select that loads options from an API as the user types, with debouncing, request cancellation and current react-select v5 usage.