Flatten Arrays in Vanilla JavaScript with flat() and flatMap()

2 years ago

ES2019 introduced two methods on the array prototype that would make life so much simpler for developers. These are flat()…

Using GroupBy on an array of objects in JavaScript

2 years ago

Array grouping is a fairly common operation in any project. Until recently, we had to either write our own implementation…

Node.js introduces node: protocol imports

2 years ago

Node.js recently introduced a node: protocol for built-in modules. Built-in node modules can now be imported by prefixing the node:…

JSON Modules in JavaScript

2 years ago

ES Modules were introduced in ES2015. The import and export keywords by default are only applicable to JavaScript code. But…

How to check if a string contains emojis in JavaScript?

2 years ago

If you have user-generated content in your web application, chances are you have to deal with strings containing emojis. Since…

Writing conditionals in CSS: when/else

2 years ago

CSS already has had conditionals in the form of @media queries or @support queries to selectively apply styling to the…

Retrieving content value of ::after or ::before in JavaScript

2 years ago

Let us suppose we had an HTML element which had an ::after property assigned to it. We are going to…

How to permanently remove a file from Git history

2 years ago

We all make mistakes sometimes. Pushing files that contain some secrets or sensitive information to a Git repository is fairly…

Select all text on click using CSS

3 years ago

When a user has to select some text on a website, they have to drag and hold their mouse, or…

Detecting element causing CSS overflow

3 years ago

CSS overflows are an annoyance that keep showing up once in a while and are really hard to debug. Unwanted…

Advertisements