Blog posts filed under “JavaScript”
- How to use event delegation with jQuery
- How I built a password toggle script in vanilla JavaScript
- Declare multiple JavaScript variables in one statement
- Building a word and character count app in vanilla JavaScript
- Named callback functions in JavaScript
- The difference between parameters and arguments in JavaScript functions
- Short-circuit evaluation in JavaScript
- Recreating jQuery's basic "effects" in vanilla JS
- How to manipulate an element's classes in vanilla JS
- Reduce an array to a single value with vanilla JS
- How to scope your selectors in vanilla JS
- How to empty an element in vanilla JS
- Returning boolean values in JavaScript
- How to check if every item in an array meets a condition
- The nullish coalescing operator in JavaScript
- How I built a random quotes app with vanilla JavaScript
- How I built a top stories feed in vanilla JS
- How to get your Jekyll posts as a JavaScript array
- How to detect form submissions in JavaScript
- How to structure a JavaScript file
- How to build a JavaScript clock
- How to stop an infinite loop in Chromium
- My favourite ES6 features
- My approach to event delegation
- How I use event delegation with Reef
- The difference between nodeName and tagName
- How to get the active element in DevTools
- Resources for regular expressions
- Two ways to create a regular expression in JavaScript
- Array literals vs the Array() constructor
- Three ways to write a JavaScript function
- Guard clauses in JavaScript
- The simplest way to check the event target
- How the Array.prototype.slice.call() trick works
- Static vs live NodeLists
- Syntax errors vs logic errors
- How to get the last item in a JavaScript array
- String concatenation in vanilla JS
- Nodes aren't always HTML elements
- Name your variables explicitly
- Everyone has JavaScript, right?
- How to manipulate attributes in vanilla JS
- Array.indexOf() vs Array.includes()
- How to get the children of an element in vanilla JS
- Get an element's total width and height in vanilla JS
- The outerHTML property in vanilla JS
- How to check an email address in vanilla JS
- Understanding client-side JavaScript frameworks
- How to write an IIFE from scratch
- The difference between break and continue in JavaScript
- The textContent and innerText properties in vanilla JS
- The console.table() method in JavaScript
- What is the DOM?
- Properties and methods in JavaScript
- Dot notation and bracket notation in JavaScript
- Introducing JavaScript objects
- Understanding prototypes and inheritance in JavaScript
- The in operator vs the hasOwnProperty() method in vanilla JavaScript
- Never rely on the global event property in JavaScript
- Event flow in JavaScript
- The difference between event target and event currentTarget
- The difference between event.stopPropagation() and event.stopImmediatePropagation()
- The event.preventDefault() method in JavaScript
- Getting started with Svelte
- The instanceof operator in JavaScript
- An addClass() helper function
- How to check if an object has at least one property in JavaScript
- Named access on the window object
- Implicit return statements in JavaScript
- The const keyword in JavaScript
- Changing the context of the forEach() callback
- The flatMap() method in vanilla JS
- The difference between null and undefined in JavaScript
- Setting defaults for package.json
- How to check if a value is an array in JavaScript
- How to inspect JSON data in Chrome DevTools and Visual Studio Code
- When should you use a switch statement in JavaScript?
- Serialize form data into a query string in vanilla JS
- Serialize form data into an array in vanilla JS
- Serialize form data into an object in vanilla JS
- Serialize form data into a JSON string in vanilla JS
- Serialize.js: A tiny form serialization library
- Get the common ancestor of two or more elements in vanilla JS
- Get a random truthy/falsy value in JavaScript
- Sorting numbers in vanilla JS
- The FizzBuzz challenge in JavaScript
- Simple is better than complex
- Long string literals in JavaScript
- How to document your JavaScript functions
- The difference between this and $(this) in jQuery
- Convert a string to title case in vanilla JS
- Loop through an object using the Object.keys() method
- The string repeat() method in vanilla JS
- Return values in JavaScript functions
- Chaining function calls in JavaScript
- The array at() method in vanilla JS
- Adding two arrays together in JavaScript
- Detect if a function was invoked as a constructor in JavaScript
- How to replace a class in vanilla JS
- Caching jQuery selections for better performance
- Type checking JavaScript in Visual Studio Code
- Numeric separators in JavaScript
- jQuery is still cool
- Implicit iteration in jQuery
- The modern syntax for the ready() method in jQuery
- Throwing errors in JavaScript
- Catching errors in JavaScript
- Working with data attributes in vanilla JS
- Browser APIs versus third-party APIs
- Accessible links in single-page apps
- The Promise.allSettled() method
- Unique array values in JavaScript
- How to choose between let and const in JavaScript
- Asynchronously check if a file exists in Node.js
- Asynchronously read and write files in Node.js
- Asynchronously append data to a file in Node.js
- Revisiting FizzBuzz
- How to get today's date in vanilla JS
- Compare dates in vanilla JS
- Nutrition cards for accessible components
- An accessible accordion component
- An accessible button component
- An accessible disclosure component
- The FocusEvent.relatedTarget property in vanilla JS
- An accessible menu component
- Event delegation in vanilla JS and jQuery
- JavaScript: Private instance members in 2022
- Handle an event once in vanilla JS
- Aborting event listeners in vanilla JS
- Inspect nested objects in Node.js
- Top-level await in vanilla JS
- Using default and named exports together in vanilla JS
- Two ways to create an img element in vanilla JS
- The URL constructor in vanilla JS
- The import.meta object in vanilla JS
- The HTMLFormElement.elements property in vanilla JS
- Understanding callback functions in vanilla JS
- Asynchronous callback functions in vanilla JS
- How to wrap a function in a Promise in vanilla JS
- Consuming promises in vanilla JS
- Async functions in vanilla JS
- Prefix vs postfix operators in vanilla JS
- Conditionally toggle a class in vanilla JS
- Prevent leaking arrow functions in vanilla JS
- Why the .at() method exists in vanilla JS
- Not everything is an object in JavaScript
- Type coercion is a feature, not a bug
- Embracing the equality operator in JavaScript
- Delegated event handlers using object methods
- Understanding the virtual DOM
- Composition in React
- Rendering API data in React
- Safely rendering HTML in React
- Client-side routing with React Router 6.4
- CommonJS vs ES modules
- Namespace imports in ES modules
- Create a range of numbers using the Array.from() method
- A simple class for numeric ranges
- Iterators and generators in JavaScript
- Generating the alphabet in JavaScript
- Building an analog clock in vanilla JS
- Pretty-printing JSON responses in Express
- Class-based access privileges
- Three ways to check if an object has a property in JavaScript
- Object.hasOwn() versus Object.prototype.hasOwnProperty()
- The .prototype property versus the [[Prototype]] internal slot in JavaScript
- Four ways to set the prototype of an object in JavaScript
- Subclassing with prototypes in JavaScript
- Extending constructors in JavaScript
- The super keyword in object literals
- An alternative to the super keyword in JavaScript
- Property descriptors in JavaScript
- Three ways to prevent changes to an object in JavaScript
- Enumerations in JavaScript
- Three ways to pass extra arguments to a function in JavaScript
- Currying and partial application in JavaScript
- New array methods in ECMAScript 2023
- Custom hooks in React
- When should you use an arrow function in JavaScript?
- Method definitions versus function properties in JavaScript
- Empty statements in JavaScript
- Find all HTML elements used on a page
- Import maps for JavaScript modules
- Aggregating JavaScript modules
- The typeof operator in TypeScript
- Encapsulation in object-oriented JavaScript (OOJS)
- Referential equality in JavaScript
- Signals in React
- Building an accessible disclosure with Petite Vue
- How to run TypeScript code in Node.js
- Is Node.js still vanilla JS?