Object.values()
received following error:
TypeError: Object.values is not a function.
From this question on stackoverflow - I see that Object.values()
is not supported in all browsers.
But I am using the function in Node.js on server side - How can I use Object.values()
in Node.js it seems so intuitive like Object.keys()
?
Answer: Use console. log() or JSON. stringify() Method You can use the console. log() method, if you simply wants to know what's inside an object for debugging purpose. This method will print the object in browser console.
Node. js is an open source JavaScript runtime environment that lets developers run JavaScript code on the server. If that's too complex for you to understand then you should think of it this way: Node. js is JavaScript that runs outside the browser — on the server.
To access the database from Node. js, you first need to install drivers for the database you want to use. The following table lists important relational databases and respective drivers. The following table lists important NoSQL databases and respective drives .
Object.values
is a new feature in ES2017. It is very bleeding edge. Node.js has full support for it from version 7.0.
6.8.1 supports it, but it is considered unstable and is locked behind the --harmony
flag.
You can either:
--harmony
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With