So Meta I Can't Take It!


#1

I am lost in this exercise, don't know what is going on, would someone please help me.
The code is working perfectly.

// what is this "Object.prototype" anyway...?

var prototypeType = typeof Object.prototype;

console.log(prototypeType);

// now let's examine it!

var hasOwn =

Object.prototype.hasOwnProperty("hasOwnProperty");


#2
Object     Object.prototype
  {}             {}

Class      Class.prototype
  {}             {}

Subclass   Subclass.prototype
  {}             {}

Instances of Object only inherit from (have access to methods and attributes of) Object.prototype.

Instances of Class inherit from Class.prototype AND Object.prototype

Instances of Subclass inherit from Subclass.prototype AND Class.prototype AND Object.prototype.


#3

why do i have two times .hasOwnProperty in the last line


#4

One is a method call, the other is the argument to the method call. We are using the method to verify that hasOwnProperty exists. Of course it will return true.


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.