for (key of Reflect.ownKeys(myObj)) {
//Do something with key or myObj[key]
}
Allen
On Dec 3, 2014, at 9:07 AM, Mark Volkmann wrote:
> It seems the typical way to do this is:
>
> Object.keys(myObj).forEach(key => {
> let value = myObj[key];
> // Do something with value and/or key.
> });
>
> I don't see a new way to do this in ES6.
>
> Is it still being considered to add the methods "entries" and "values" to Object that return iterators?
>
> --
> R. Mark Volkmann
> Object Computing, Inc.
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
d at domenic.me (2014-12-08T21:42:09.864Z)
```js
for (key of Reflect.ownKeys(myObj)) {
//Do something with key or myObj[key]
}
```
for (key of Reflect.ownKeys(myObj)) { //Do something with key or myObj[key] } Allen On Dec 3, 2014, at 9:07 AM, Mark Volkmann wrote: > It seems the typical way to do this is: > > Object.keys(myObj).forEach(key => { > let value = myObj[key]; > // Do something with value and/or key. > }); > > I don't see a new way to do this in ES6. > > Is it still being considered to add the methods "entries" and "values" to Object that return iterators? > > -- > R. Mark Volkmann > Object Computing, Inc. > _______________________________________________ > es-discuss mailing list > es-discuss at mozilla.org > https://mail.mozilla.org/listinfo/es-discuss