Can I catch an error from async without using await?

Dealing with unhandled rejected native promises (and async/await uses native promises) is a feature supported now in V8. It’s used in the latest Chrome to output debugging information when a rejected promise is unhandled; try the following at the Babel REPL: async function executor() { console.log(“execute”); } async function doStuff() { console.log(“do stuff”); throw new … Read more

IE does not support Array includes or String includes methods

Because it’s not supported in IE, it is not supported also in Opera (see the compatibility table), but you can use the suggested polyfill: Polyfill This method has been added to the ECMAScript 2015 specification and may not be available in all JavaScript implementations yet. However, you can easily polyfill this method: if (!String.prototype.includes) { … Read more

What is after Internet Explorer 11 on Windows 7? How well will ES2016 be supported in enterprises?

With JavaScript now being updated each year (ES2015, ES2016, ES2017, etc.), how does Microsoft plan to keep IE 11 up to date? They’re not going to. As of 2015, Internet Explorer 11 will no longer be receiving any new features or platform bug fixes. Only security updates will be provided to IE11 from here on … Read more

VSCode Linter ES6 ES7 Babel linter

How I proceed: install globally eslint : npm install -g eslint install babel-eslint : npm install –save-dev babel-eslint install eslint-plugin-react : npm install –save-dev eslint-plugin-react create .eslintrc file in you root directory. here is my config: { “env”: { “browser”: true, “node”: true, “es6”: true, “jest”: true, “jquery”: true }, “parser”: “babel-eslint”, “parserOptions”: { “ecmaVersion”: … Read more

Best way to polyfill ES6 features in React app that uses create-react-app

Update: The create-react-app polyfill approach and docs have changed since this question/answer. You should now include react-app-polyfill (here) if you want to support older browsers like ie11. However, this only includes the “…minimum requirements and commonly used language features“, so you’ll still want to use one of the approaches below for less common ES6/7 features … Read more

How do I destructure all properties into the current scope/closure in ES2015?

I think you’re looking for the with statement, it does exactly what you are asking for: const vegetableColors = {corn: ‘yellow’, peas: ‘green’}; with (vegetableColors) { console.log(corn);// yellow console.log(peas);// green } However, it is deprecated (in strict mode, which includes ES6 modules), for good reason. destructure all properties into the current scope You cannot in … Read more