Tagged: JavaScript
18 articles tagged JavaScript across all clusters on CodeWalkers.
Timers, Ordering, and Race Conditions in JavaScript
setTimeout and setInterval, the order callbacks actually print in, the stale response race that breaks search boxes, debounce and throttle, and cleaning up when the owner disappears.
Node.js File Handling, Environment Variables, and Scripts
Reading and writing files with fs/promises, paths that survive the wrong working folder, keeping keys out of code with env files, and one worked bulk edit with a dry run.
Modules, Imports, and Exports in JavaScript
Splitting JavaScript across files: named against default exports, import paths that actually resolve, ES modules against CommonJS, script type module, and load-order surprises.
Node.js package.json, npm, and Scripts Explained
The fields Node and npm each read, why dependencies and devDependencies are separate lists, naming commands as npm scripts, what a lockfile protects, and when npx is the right tool.
JavaScript Event Cleanup and Page Lifecycle
removeEventListener and why it so often does nothing, retiring listeners with one AbortController, script defer against DOMContentLoaded, and why these leaks survive a framework.
Events, Forms, and User Input in JavaScript
addEventListener and the event object, preventDefault, one delegated listener for a whole list, reading a form with FormData, the browser's own validation, and honest loading states.
How to Run JavaScript Files and Commands with Node.js
Checking your install and reading version numbers, running a file, what type module changes, reading arguments from process.argv, the two output streams, and exit codes.
Fetch, JSON, and the Network in JavaScript
Requesting data with fetch, the response.ok check most tutorials skip, parsing JSON, sending data with POST, telling a bad answer from no usable answer, and timeouts with AbortController.
Objects, Arrays, and Destructuring in JavaScript
Object literals and property access, the array methods worth knowing, destructuring, spread and rest, when Map and Set beat a plain object, and copying without mutating.
JavaScript DOM: Select Elements and Update the Page
querySelector and querySelectorAll, textContent against innerHTML and when each is safe, adding and removing classes, attributes and data values, and building or deleting elements.
Promises and async/await in JavaScript
What a promise is and the three states it can be in, then and catch, the async and await keywords, waiting on overlapping work with Promise.all, and where a thrown error ends up.
Node.js Guide: JavaScript Scripts, Packages, and Files
JavaScript run on your own machine: what Node is, the handful of terminal commands you actually need, and the three guides covering running files, package.json, and file automations.
Functions, Callbacks, and Closures in JavaScript
Declarations against expressions, arrow functions and what this binds to, default and rest parameters, callbacks, closures, and functions that take or return functions.
JavaScript DOM Guide: Elements, Events, and Forms
The JavaScript that changes a web page: finding and updating elements, reacting to clicks and forms, and taking your listeners back off again.
Async JavaScript: Promises, Fetch, and Timers
The JavaScript that runs later: promises and await, fetching data over the network, and the ordering rules behind timers and race conditions.
Values, Variables, and Equality in JavaScript
let and const, the primitive types, type coercion, == against ===, truthiness, the difference between null and undefined, and the ?? and ?. operators.
JavaScript Basics: Values, Functions, and Modules
The four pieces of JavaScript every other page assumes: values and equality, functions and closures, objects and arrays, and modules that split code across files.
JavaScript vs TypeScript: Which Should You Learn?
JavaScript and TypeScript are the same language with one big difference: types. Here is what TypeScript actually adds, when the extra step pays off, and which one a beginner should start with.