Augusto Moura (2018-04-24T16:58:00.000Z)
augusto.borgesm at gmail.com (2018-04-24T17:15:57.459Z)
Assuming `Object.keys` has the same order as a simple `for..in` (as stated in mdn)[ https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys], we can already implement a function to build a iterator from object keys, and then we can destruct or use others helpers to minimize the array creation. Something like: ``` js function* keysIterator(obj) { for (const key in obj) { if (obj.hasOwnProperty(key)) { yield key; } } } const obj = { foo: 12, bar: 89 }; // Using destructuring const [firstProp, secondProp, ...othersKeys] = keysIterator(obj); // Using some helper functions const props = take(2, 10)(obj); ``` The discussion IMHO is if we need that as a built in helper (maybe `Object.keysIterator()`), and if we need to extend it to `Object.values` and `Object.entries`.