- configurable
- enumerable
- writable
- value
- get & set function
References
All objects have an internal property called [[Prototype]]. The value of this property is either null or an object and is used for implementing inheritance.
[[Prototype]]
- An object specifies its prototype via the internal property
proto
-
This brings direct access to
[[Prototype]]
to the language(by speakingjs.com). -
__proto__
is the actual object that is used in the lookup chain to resolve methods, etc. prototype is the object that is used to build__proto__
when you create an object with new:
prototype
prototype
is the object that is used to build__proto__
when you create an object withnew
.prototype
is not available on the instances themselves (or other objects), but only on the constructor functions.prototype
is only available on functions since they are copied from Function and Object, but in anything else it is not. However,__proto__
is available everywhere.
( new Foo ).__proto__ === Foo.prototype;
( new Foo ).prototype === undefined;
- https://hackernoon.com/understand-nodejs-javascript-object-inheritance-proto-prototype-class-9bd951700b29
- https://stackoverflow.com/questions/9959727/proto-vs-prototype-in-javascript
- https://stackoverflow.com/questions/9451881/prototype-vs-prototype-what-is-the-difference-mycons-proto-myco/46463288#46463288
Reference
JSON.parse(JSON.stringify(nestedObject));
- Spreed Operator
- Object.assign({}, Obj1)
Reference
- https://medium.com/better-programming/3-ways-to-clone-objects-in-javascript-f752d148054d
- https://stackoverflow.com/questions/122102/what-is-the-most-efficient-way-to-deep-clone-an-object-in-javascript
- https://stackoverflow.com/questions/32925460/object-spread-vs-object-assign
https://stackoverflow.com/a/7614380
- https://stackoverflow.com/questions/1635116/javascript-class-method-vs-class-prototype-method
- https://stackoverflow.com/questions/11249037/javascript-this-in-static-methods
- Sorting Objects - https://gist.github.com/thamsrang/f3178b17002d74d6f4b3766af50ca358
- Event Handler - https://gist.github.com/thamsrang/ba6a14d06cce3bb704567d8d918a12fb
- Javascript key terms - https://gist.github.com/thamsrang/8aa48e568fb5c5c5964baf205f2b6e0d
- type_coercion - https://gist.github.com/thamsrang/ceda5f22af8923acb9a2e7d831b6a5be