Error:TypeError: Object.values is not a function.

0 votes

Object.values() received following error:

TypeError: Object.values is not a function.

I have seen 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()?

Oct 15 in Node-js by kartik
• 35,720 points
49 views

1 answer to this question.

0 votes

Hello @kartik,

Object.values is a new feature . It is very bleeding edge. Node.js has full support for it from version 7.0.

You can either:

  • Upgrade to the latest Node.js LTS and use --harmony
  • Upgrade to the latest Node.js Current
  • Use a polyfill
answered Oct 15 by Niroj
• 77,920 points

Related Questions In Node-js

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Error:node' is not recognized as an internal or external command

Hello @kartik, Node is missing from the SYSTEM ...READ MORE

answered Oct 15 in Node-js by Niroj
• 77,920 points
186 views
0 votes
1 answer

ReferenceError: primordials is not defined in node

Hello @kartik, Use following commands and install node v11.15.0: npm ...READ MORE

answered Jul 12 in Node-js by Niroj
• 77,920 points
2,411 views
0 votes
1 answer

How to write files in Node.js?

Hello @kartik, Currently there are three ways to ...READ MORE

answered Jul 8 in Node-js by Niroj
• 77,920 points
97 views
0 votes
1 answer

How to Install a local module using npm?

Hello @kartik, This is what worked for me: npm ...READ MORE

answered Jul 9 in Node-js by Niroj
• 77,920 points
103 views
0 votes
1 answer

How to run Gulp tasks sequentially one after the other?

Hello @kartik, By default, gulp runs tasks simultaneously, ...READ MORE

answered Jul 12 in Node-js by Niroj
• 77,920 points
65 views
0 votes
1 answer

How to set environment variables from within package.json?

Hello @kartik, Set the environment variable in the ...READ MORE

answered Jul 13 in Node-js by Niroj
• 77,920 points
2,803 views
0 votes
2 answers

Error:'TypeError: is not a function' in Node.js

You are exporting module.exports.redir = redir; That means that ...READ MORE

answered Oct 21 in Node-js by anonymous
• 140 points
518 views
0 votes
1 answer

Error:nvm is not compatible with the npm config "prefix" option:

Hello @kartik, After installing nvm using brew, create ~/.nvm directory: $ ...READ MORE

answered Jul 15 in Node-js by Niroj
• 77,920 points
533 views