es2015

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…

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…

4 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…

4 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…

4 years ago

Using Babel to import/export ES2015 modules in Node.js

Using "require" statements (commonJS syntax) in your server side code while writing "import" and "export" statements (ES2015 syntax) for your…

7 years ago
Advertisements