Alternative version for Object.values()

You can get array of keys with Object.keys() and then use map() to get values.

var obj = { foo: 'bar', baz: 42 };
var values = Object.keys(obj).map(function(e) {
  return obj[e]
})

console.log(values)

With ES6 you can write this in one line using arrow-functions.

var values = Object.keys(obj).map(e => obj[e])

Object.values() is part of the ES8(June 2017) specification. Using Cordova, I realized Android 5.0 Webview doesn't support it. So, I did the following, creating the polyfill function only if the feature is not supported:

if (!Object.values) Object.values = o=>Object.keys(o).map(k=>o[k]);