JavaScript: fix “SyntaxError: cannot use import statement outside a module”

7 months ago

I recently was working with a third-party library. I ran into the error "Uncaught SyntaxError: cannot use import statement outside…

How to reload zsh configuration

7 months ago

I have been using zsh for quite some time now and learned something new while setting up some commands today.…

How to sort a Set in JavaScript

1 year ago

ES6 introduced the set data structure in JavaScript. But sets are not ordered abstract data structures. So there is no…

Debugging CSS scroll using one simple style

1 year ago

I have been doing a lot of complicated front-end work off lately and that always brings me back to the…

CSS :has a parent selector now

1 year ago

CSS now includes a :has selector that allows us to apply styles on the basis of what is happening inside…

How to fix “xcrun: error: invalid active developer path” after MacOS update

1 year ago

If you are here, then you are getting an "invalid active developer path" error on running commands in the terminal…

Getting the value of an input element as a number without parseInt

2 years ago

Every once in a while, you come across something and you think, how did I not know this earlier? valueAsNumber is…

Using Font Awesome with React

2 years ago

Font Awesome is a great resource to use various types of icons in your project including well-known social media icons…

How to write comments in React (JSX)?

2 years ago

I was recently trying to comment out some logic inside my JSX to add context about what a potentially complex…

How to write more readable JavaScript conditionals

2 years ago

One of the practices of clean code is to make it more readable. And a fairly common use case in…

Advertisements