Enhanced Object Literals in ES6

Sarah Chima on November 01, 2017

Object literals make it easy to quickly create objects with properties inside the curly braces. To create an object, we simply notate a list of k... [Read Full]
markdown guide
 

Thank you Sarah, I Liked it

typo:
think u meant to write es6 and not 5 in:

"
...
//ES5
function getLaptop(make, model, year) {
return{
sayModel() {
return model;
....
"

 
 
 

You could throw in a count, and the name, in case you want to iterate by index.

{
[name + ++i]: "Apple",
[name + ++i]: "Dell",
[name + ++i]: "HP",
count: i,
name
}

 
 

awesome post. Really really explanatory . Good examples that further explain the concepts discussed . Excellent !

 

I liked it but i did not get the advantage of computed properties. It looks weird to me :(

code of conduct - report abuse