Common regular expressions
A collection of regular expressions that can be used to solve common problems.
The JavaScript snippet 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.
A collection of regular expressions that can be used to solve common problems.
Learn how to compact an array or object in JavaScript using the Boolean
function and recursion.
Returns an array containing all the siblings of the given element.
Learn how to use regular expressions to replace the last occurrence of a pattern in a JavaScript string.
Learn how you can implement a delay function using setTimeout()
, promises and async
/await
.
Learn how to trigger an event on an HTML element using JavaScript.
Learn how to shuffle, sample and perform weighted selection on JavaScript arrays.
Learn how to split a JavaScript array into two groups based on a function or an array of values.
JavaScript callbacks are especially tricky when you're not careful. Take a deeper dive into potential issues and how to avoid them.
Learn how to group and count the values of a JavaScript array using simple array methods.
ESLint is a really useful tool, but sometimes it gets in the way. Learn how to refactor code to get rid of a common warning.
Understand how events work in JavaScript and learn when to use event bubbling, event capturing and event delegation with this short guide.
Find all the keys in a JavaScript object that match the given value.
Learn the differences between the three most commonly used iteration methods in JavaScript, that often confuse beginners and veterans alike.
Creates an object from an array, using a function to map each value to a key.
SDBM is a simple, non-cryptographic hash function that can hash strings into whole numbers. Here's a JavaScript implementation.
Easily convert an hsl()
color string to an array of values or an object with the values of each color.
Have you ever wanted to serialize an object but only include certain keys? Turns out JavaScript provides an easy way to do this!
Performs left-to-right function composition for asynchronous functions.
JavaScript's promises represent the eventual completion (or failure) of asynchronous operations and their resulting value.
Learn how to resolve promises one after another (sequentially) in JavaScript.
Trailing commas are not without controversy. Here's why I think you should use them.
JavaScript's this
keyword can confuse beginners and veterans alike. Learn how it works in different scenarios and start using it correctly.
Roman numerals are often used for stylistic reasons, but converting an integer to a roman numeral can be a bit tricky.