Hi there,

I'm reading a book on Javascript and trying to understand a few concepts that are about hasOwnProperty(), propertyIsEnumerable() and isPrototypeOf(). I don't understand when and how these methods are used. That would so appreciated if someone can explain them to me in a nutshell.

This example is from the same book:

var o = {};

// how do we read the line below ?????
Object.prototype.isPrototypeOf(o);                 // true: o.constructor == Object
Object.isPrototypeOf(o);                           //false
o.isPrototypeOf(Object.isPrototypeOf);             // false
Function.prototype.isPrototypeOf(Object);          //true: Object.constructor == Function

Recommended Answers

All 2 Replies

Thanks. I already had a look at it but it didn't help much.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.