So Meta I can't Take it - Discussion


#1


https://www.codecademy.com/courses/objects-ii/5/3?curriculum_id=506324b3a7dffd00020bf661#


Hey Everyone,

I have the working solution posted below for "so Meta I cannot Take it". And my code works, but maybe you can help me understand what is happening here.

Is the code on line 2 and 6 running checks on objects that aren't being set any where in the script? Basically can I use typeof & hasOwnProperty on objects that don't exist as a way of checking the "rules" of Javascript?

This was a neat lesson and if my understanding is correct, it's very meta


// 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");
console.log(hasOwn);


#2

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