es6

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

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

7 months ago

How to sort a Set in JavaScript

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

1 year ago

How to remove a property from a JavaScript object

There are two ways to remove a property from a JavaScript object: one is the mutable way of doing it…

3 years ago

Optimizing JavaScript loading with defer and async attributes

We are all used to using the script tag to load external JavaScript files in our HTML. Traditionally, the only…

3 years ago

How to format a Number as Currency using ES2015

The process to format a number as currency can be a tedious task. It feels like a small task, but…

3 years ago

JavaScript Proxy: What and Why?

EcmaScript 2015 introduced yet another feature that has not been used widely yet. A JavaScript proxy allows us to wrap…

3 years ago

Object initialization shorthand notations in JavaScript

I was recently working on a project in which I was trying to use a shorthand notation for destructuring assignment…

3 years ago

The new Logical Assignment Operators in JavaScript

The latest version of ECMAScript introduced three new logical assignment operators: nullish, AND, and OR operators. These are supported from…

4 years ago
Advertisements