Debounce a JavaScript function and return a promise
Easily create a debounced function that returns a promise.
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.
Easily create a debounced function that returns a promise.
Learn how to create a unit converter data structure in JavaScript that can convert between any compatible units.
JavaScript's strict mode can make your code faster, cleaner and more secure.
Understand the basics of function composition, a fundamental concept in functional programming.
Learn how to create a generator function that repeats a given value or an array of values indefinitely.
Learn and understand closures, a core concept in JavaScript programming, and level up your code.
Creates a function that invokes the provided function with its arguments arranged according to the specified indexes.
Static and instance methods are pretty easy to distinguish and serve different purposes. Learn all about them in this article.
Creates a generator, that generates all dates in the given range using the given step.
Create a debounced function that waits a certain amount of time before invoking the provided function again.
Takes a function as an argument, then makes the first argument the last.
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.
Understanding the differences between synchronous and asynchronous code is a crucial piece of knowledge for every web developer.
Ensures a function is called only once.
A JavaScript promise's then
and finally
methods seem very similar. But there are a few important differences you need to keep in mind.
Randomness and pure functions don't seem to go hand in hand. But where there's a will, there's a way.
Pure functions are a very important concept to know, especially if you're interested in functional programming.
A short introduction to the functional programming paradigm.
Converts an asynchronous function to return a promise.
The constructor is a crucial part of any JavaScript class, which is why you might want to take a closer look at what they return.
Recursion is a very important programming concept all developers should be familiar with.
Converts the output of a generator function to an array.
Messing up the order of chained then
and catch
methods in JavaScript promises can cause problems. Here's a short primer on the subject.
Learn how to create a promise that resolves after a given amount of time in JavaScript.