require-polyfills
Version:
Collection of polyfils that load automatically using require-bundle-js by detecting what is missing in the browser.
18 lines (16 loc) • 521 B
JavaScript
/**
* Extend browser support for Object.entries all the way back to IE9.
*
* Author: MDN
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries#Polyfill
*/
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;
};
}