"So Meta I Can't Take It" lesson


This lesson got me thinking deep. So when we write a code for a basic object, it is a copy/prototype of the object"Object.prototype"?
If "Object.prototype"is an object then what is "Object"?


the Javascript-engine is the ultimate Top
and is reached as soon as you encounter ""


A prototype is an early sample, model, or release of a product
built to test a concept or process or
to act as a thing to be replicated or learned from.
The word prototype derives from the Greek πρωτότυπον prototypon,
"primitive form", neutral of πρωτότυπος prototypos,
"original, primitive", from πρῶτος protos, "first" and τύπος typos, "impression".


Inheritance and the Prototype Chain

Prototypal Inheritance is Dynamic

One of the most important advantages of prototypal inheritance is
that you can add new properties to prototypes after they are created.
This allows you to add new methods to a prototype
which will be automatically made available
to all the objects which delegate to that prototype.

This is not possible in classical inheritance
because once a class is created you can't modify it at runtime.
This is probably the single
biggest advantage of
prototypal inheritance
over classical inheritance,
and it should have been at the top.


Prototypal inheritance matters.
It's important to educate JavaScript programmers
on why to abandon the constructor pattern of prototypal inheritance
in favor of the prototypal pattern of prototypal inheritance.

We need to start teaching JavaScript correctly
and that means showing new programmers how to write code
using the prototypal pattern instead of the constructor pattern.

Not only will it be it easier to explain
prototypal inheritance using the prototypal pattern,
but it will also make better programmers

++++++++ a String type explained ++++++

why it should be Object.prototype.hasOwnProperty....
The hasOwnProperty Method is the only method
which will be fetched from the Object.prototype WITHOUT traversing
through the prototype Chain.

In the following link:
Under the Header:

The lookup time for properties that are high up on the prototype chain can have a negative impact on performance, and this may be significant in code where performance is critical. Additionally, trying to access nonexistent properties will always traverse the full prototype chain.

Also, when iterating over the properties of an object, every property that is on the prototype chain will be enumerated.

To check whether an object has a property defined on itself and not somewhere on its prototype chain, it is necessary to use the hasOwnProperty method which all objects inherit from Object.prototype.

hasOwnProperty is the only thing in JavaScript which deals with properties and does not traverse the prototype chain._

google search
== the Book ==
javascript [your question] site:developer.mozilla.org

== discussions / opinions ==
javascript this explained site:stackoverflow.com
= http://stackoverflow.com/questions/3127429/how-does-the-this-keyword-work
== guidance ==


Thanks for the explanation! Could someone change (add properties, values and methods) to the master Object.prototype in their programming? Would someone want to?


Try a google search
== discussions / opinions ==
Could someone change (add properties, values and methods) to the master Object.prototype in their programming site:stackoverflow.com

start reading, and as your knowledge increases,
refine the question


Thanks leonhard for the awesome explanation :+1: :ok_hand:
I got my answer


I am getting this error when trying to execute the code.Please help me with this issue:



Have a look at line-2



Thank you!!!! :smile: leonhard