Ryan
Ryan

Reputation: 14649

Node v0.10.36 showing prototype of an Object

Back in the day, I could do Array.prototype and it would show me the properties of the prototype member of the Array object. Even doing console.dir(Array.prototype) does not work in Node, however, it does work in the browser. Is there a new API that can show me the properties?

Upvotes: 1

Views: 41

Answers (1)

user2263572
user2263572

Reputation: 5606

This should do it for you. Browser consoles usually have interactive displays for objects. The node repl does not have the same feature, so you have to do the below to get a similar effect.

Object.getOwnPropertyNames(Array.prototype)

Upvotes: 2

Related Questions