ES6 Common Issues

This article introduces common ES6 issues, including advantages, implementation details, and related resources that can help improve efficiency when working with ES6.

Dec 12, 2017 · 1 min read · 80 Words · -Views -Comments · Programming

The emergence of ES6 (ECMAScript2015) has brought new surprises to front-end developers. It contains some great new features that make it easier to implement many complex operations and improve developer efficiency. Since I use Node and Angular, I can directly use ES6. I encountered some issues during actual use, so I’m noting them here.

Adding Dynamic Keys to Objects

Use Computed Property Names

var key = 'DYNAMIC_KEY',
    obj = {
        [key]: 'ES6!'
    };

console.log(obj);
// > { 'DYNAMIC_KEY': 'ES6!' }
Authors
Developer, digital product enthusiast, tinkerer, sharer, open source lover