Concurrency & Event Loop
enumerable property, hasOwnProperty is derived from Object.prototype => to check whether the property is derived.
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
prototype and Object.getPrototypeOf
– prototype works with new operator. by setting the source prototype reference to the target prototype property before the constructor is called.
obj.[[Prototype]] = o.Prototype
prototype is for types, while
Object.getPrototypeOf() is the same for instances.
Prototype check is recursive.
This means that all the stuff you define in
prototype is effectively shared by all instances, and you can even later change parts of
prototype and have the changes appear in all existing instances, if you wanted to.
Object type and object instance. OOP in JS is classless, prototype-oriented, or instance-based programming – that uses polymorphism.
Callbacks can be used in various utilities. The use of callbacks is for saving the state of values that were available to us when the callback was issued. This data can be returned in a synchronous way. Returning it in synchronous way is necessary since the state must be update with the correct values before it is returned.
Client-side rendering vs Server side rendering:
__proto__ -> Function.prototype