Object.entries polyfill
zewa666 opened this issue · 2 comments
zewa666 commented
With ES2017 there is Object.entries
which is not yet covered by aurelia polyfills.
It would be great if we could add that as well.
I'm just not certain where to add this, since there are no ES2017 polyfills prepared yet if I'm not wrong.
if (!Object.entries)
Object.entries = function( obj ){
var ownProps = Object.keys( obj ),
i = ownProps.length,
resArray = new Array(i); // preallocate the Array
while (i--)
resArray[i] = [ownProps[i], obj[ownProps[i]]];
return resArray;
};
EisenbergEffect commented
You could add it here: https://github.com/aurelia/polyfills/blob/master/src/object.js
zewa666 commented
Closed due to discussion in linked PR