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


#1


The software agrees that my code is correct and tells me to move on to the next lesson, but the things that should be printed don't appear in the console. Any reason why? Just curious if it's a glitch on the softwares part, or if I made a mistake that the software didn't notice.


var prototypeType = typeof Object.prototype;
console.log(prototypeType);

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


#2

what are the things logged to the console? object on the first line and true on the second? Then the output is correct, here:

var prototypeType = typeof Object.prototype;

you use typeof, which gives you the type (object in this obvious case), which you then log to the console

then you check if object has hasOwnProperty, it has (since you use prototype to add it) so true is returned, sounds fine to me?


#3

Refresh thy browser and see if she works.


#4

did you read the question? quote:

the code works fine, (s)he asks for explanation


#7

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