Automatic extension Object.prototype how? Read for more details


#1


It is regarding 29. So meta I cant take it.

"If we have just a plain object (i.e., not created from a class constructor)
recall that it automatically inherits from Object.prototype. "

Then my question is when i will create a new object(plain), 
would following line of code execute?

Object.prototype = new myObject();

Shouldn't it be like?

myObject.prototype = new Object();

Now I most certainly be wrong, but Can you shed some light on how it
automatically extends Object.prototype? 

Thank you in advance.


#2

@udit_47,
Please read the following article's and then rephrase your question...

http://www.codecademy.com/forum_questions/545976cd282ae30d66001811
http://stackoverflow.com/questions/572897/how-does-javascript-prototype-work
http://stackoverflow.com/questions/310870/use-of-prototype-vs-this-in-javascript
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Inheritance_and_the_prototype_chain

An object has one or more properties, separated by a comma_,

A property has a property-key and it's associated VALUE

The VALUE can be anything from:

•Number
•String
•Boolean
•Symbol
•Object  ◦Function/'Method'
         ◦Array
         ◦Date
         ◦RegExp
         ◦Math
•Null
•Undefined

#3

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