DEV Community

Discussion on: Enhanced Object Literals in ES6

Collapse
 
aydinakcasuatquickenloans profile image
aydinakcasuAtQuickenLoans

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
}