Can I validate an email address in JavaScript?
Email address validation can be much trickier than it sounds. Here's why and my advice on how to approach this problem.
The JavaScript article collection contains a wide variety of ES6 helper functions. It includes helpers for dealing with primitives, arrays and objects, as well as algorithms, DOM manipulation functions and Node.js utilities.
Email address validation can be much trickier than it sounds. Here's why and my advice on how to approach this problem.
Learn how to extract command-line arguments passed to a Node.js script.
Learn how to check if all values in an array are true or false.
Sort an array of numbers, using the bubble sort algorithm.
Quickly and easily check if a string is a yes/no answer to a boolean question in your CLI programs.
Learn how to type check for different types of streams in Node.js.
String splitting and truncation, both simple and locale-sensitive are possible in JavaScript. Learn how in this guide.
Learn how to get the first or last N elements of a JavaScript array, using Array.prototype.slice().
Understanding the differences between synchronous and asynchronous code is a crucial piece of knowledge for every web developer.
Circular JSON objects can't be serialized using JSON.stringify(), but you can use this trick to handle them.
Injecting CSS into a page via JavaScript is pretty easy, if you know how to leverage the DOM.
Freezing objects is not the only way to prevent mutations. Learn how you can leverage the Proxy object to your advantage.
Learn how to redirect the page to HTTPS if it's currently in HTTP.
Create a function that ensures another function is called only once.
Have you ever tried appending elements to an array in JavaScript? Here's a primer on all the available options.
Adding a key-value pair to a JavaScript object is straightforward, yet there are multiple ways available to do so.
JavaScript's switch statement often feels hard to remember and a little bit out of place. Maybe it's time to use object literals, instead.
Get all the partial substrings of a string in JavaScript using generator functions.
JavaScript ES6 introduced us to powerful new features, such as the spread and rest syntax. Learn all you need to know in this quick guide.
Learn how semantic versioning works and how to use it to correctly version your software.
Ever wanted to run a function on each animation frame? This article shows you how to do it using Window.requestAnimationFrame().
JavaScript ES2020 introduced optional chaining and nullish coalescing. Learn everything you need to know with this quick guide.
Quickly find the minimum or maximum date in an array of dates.
Use a regular expression to check if a string contains only alpha or alphanumeric characters in JavaScript.