Object.values() received following error:
TypeError: Object.values is not a function.
From this question on stack
Object.values() is in status "Draft" for the version ECMAScript2017 and here the specification: ECMAScript 2017 Draft (ECMA-262) The definition of 'Object.values' in that specification..
The Object.values() method returns an array of a given object's own enumerable property values, in the same order as that provided by a for...in loop (the difference being that a for-in loop enumerates properties in the prototype chain as well).
Without change nothing in your NodeJS enviroment you can achive the same by using Object.keys() that returns an array of keys and chaining a Array.prototype.map() method to return the desired array of the Object's values:
const obj = {
foo: "bar",
baz: 42
},
// Object.values()
objValues = Object.values(obj),
// Object.keys() and map(),
objKeysMap = Object.keys(obj).map((k) => obj[k]);
console.log('objValues:', objValues);
console.log('objKeysMap:', objKeysMap);