DEV Community

Discussion on: Computed property names => ES6 !!!!

Collapse
 
lukens profile image
lukens

Hi, sorry, but as far as I can see, your two examples have nothing at all to do with computed property names. Computed property names are about using dynamic names for properties in the object initialiser, not adding them afterwards, as you have always been able to do.

In your two examples your object initialiser specifies no fields at all, and you then add the fields afterwards in the forEach.