how to use Array.sort()
How to use the Array.sort() method…
How to use the Array.sort() method…
An observable is a stream of 0 or more values. The stream comes in over a period of time. The stream is cancelable.…
Create a function to turn any function into a "promisfied" function. Any function to be promisified will always have a callback as the last argument.…
How to use Promises in JavaScript to write asynchronous code. And how we can use Async and Await to help us write our async code in a sync style.…
Not every app or webpage needs to be done in React, Vue or the latest framework. Sometimes, you just need plain old HTML, CSS and JavaScript to get the job done. Here's a handy guide for DOM manipulation with Vanilla JS.…
The useEffect hook behaves similar to componentDidMount, componentDidUpdate, and componentWillUnmount lifecycle hooks combined. It allows you to perform any (side)effects, such as API calls, without blocking the UI render.…
If you want to check if dark-mode is enabled somewhere in your code, you would simply check if `matchMedia` exists on the browser and check if it has `prefers-color-scheme` set to dark.…
How can you clean your data to remove duplicate values from an array? There are many different approaches, and here's two I like for their simplicity and elegance.…