29/30 So Meta I Can't Take It!


This topic really confusing me. I am not sure how to proceed with this. Please help me in this.

// what is this "Object.prototype" anyway...?
var prototypeType = typeof Object.prototypeType
console.log(typeof prototypeType);

// now let's examine it!
var hasOwn = object.prototype.hasOwnProperty("hasOwnProperty");


The instruction states

Let's first see what type Object.prototype is. Do this in line 2 and save it into prototypeType.

So you are finding the type of Object.prototype and remember the O has to be capital check that for everything


Yes that capital check passed the script. :blush: simple change but impacts a lot :smile:


try this out!

var prototypeType = typeof Object.prototype


What does my head in with some of these Codecademy examples is the way they name some of these components. It creates confusion in my brain when all of the parts of the code look the same. I see all these prototypes and Types and Owns and I struggle to understand this:

var prototypeType = typeof Object.prototype;

var hasOwn = Object.prototype.hasOwnProperty("hasOwnProperty");

Yet this makes perfect sense:

var banana = typeof Object.prototype;

var bacon = Object.prototype.hasOwnProperty("hasOwnProperty");

The examples are not helpful - I waste so much time trying to decipher what they are asking me to do because the text they are using I can't relate to.


Great point, some of the earlier examples included seemingly intentional stumbling blocks in the naming conventions. I'm sure they weren't really intentional, but the extra step of deciphering names does make the exercises infinitely more challenging for beginners like myself.


This line:

var hasOwn = object.prototype.hasOwnProperty("hasOwnProperty");

You need to capitalize object:

var hasOwn = Object.prototype.hasOwnProperty("hasOwnProperty");


For what it's worth, I agree with you.


they should give you a job writing their examples. thx. that was really helpful


so what does hasOwnProperty do?
can you point to a explanation of why it exists and where and why it is used.
it seems as this is something that just should make sense and is glossed over without a explanation. that is for a beginner, using this course as a introduction to Javascript.


I used parentheses in line 2 because typeof is acts like a function (i.e., it's passed an input and returns an output).
var prototypeType = typeof(Object.prototype);

The console showed that everything worked as expected, but the system didn't accept my answer until I removed the parentheses. I hope the new JavaScript class gives warning messages for these cases of doing something that makes sense and works the exact same way, but which is technically wrong and not accepted by Codecademy.

Edit: Some research brings up http://w3resource.com/javascript/operators/typeof.php, which says the following:

What is the difference between typeof myvar and typeof(myvar) in JavaScript?
There is absolutely no difference between typeof myvar and typeof(myvar).

So apparently the parentheses were merely redundant and not wrong.


strong point, often the wording totally throws me, then I'll come into the forum and it makes waaaay more sense. Good thing they've got the forum i suppose, good net for catching anything we all don't understand