I\'m looking for an alternative version for the Object.values() function.
As described here the function is not supported in Internet Explorer.
When
Since Object is a (not so) recent implementation, if you want to support all browsers (AKA IE8 and below), then you need to create your own function:
function objectValues(obj) {
var res = [];
for (var i in obj) {
if (obj.hasOwnProperty(i)) {
res.push(obj[i]);
}
}
return res;
}
PS: Just noticed the ecmascript-6 tag. Btw I keep this answer here, just in case someone needs it.