Fri. Nov 8th, 2019

Host your Website

Read and learn

FatCow Plan for $3.15/mo. only

Computed Property Names in JavaScript | ES6 | ES2015

1 min read



In this video, you’ll learn how to have an expression be computed as a property name on an object in JavaScript using ES6’s (ES2015) “computed property names” feature.

🚀 Try our new 2019 React Course – https://tylermcginnis.com/courses/react/?s=youtube-computed-property-names-es6

📺 Subscribe to our channel for more educational content to help you master the JavaScript ecosystem: https://www.youtube.com/tylermcginnis

💻 TylerMcGinnis.com is a linear, project-based approach to mastering the JavaScript ecosystem. Our React courses have been taken by over 80k students with an average rating of 4.8/5. So whether you want to learn more about React Hooks, React Native, React Router, vanilla JavaScript, or all of the above, our in-depth courses and tutorials will teach you everything you need to know about utilizing these technologies in 2019.

🏃 Visit our website for more in-depth, highly-rated educational content to help you master the JavaScript ecosystem: https://tylermcginnis.com/

4 thoughts on “Computed Property Names in JavaScript | ES6 | ES2015

  1. How do you know what the name of your variable / let is in the second example (since in the first you know it's "obj")? Or is that shorter way of writing meant to only be used if you will not use the variable somewhere else?

  2. I'm also teaching JS and I am struggling to find any kind of real-life use-case for this syntax. Your example is very nice, but still a bit artificial. Do you know any real practical cases, when this syntax is useful?

Comments are closed.

Copyright © All rights reserved. | Newsphere by AF themes.