Guanlun Zhao
Web developer and learner who occasionally writes.
Find me on Github: github.com/guanlun
TIL: Some Javascript Good Parts

Javascript Prototypal Inheritance

Javascript has a half-prototypal-half-classical OOP paradigm. new Foo() creates an object that inherits not from Foo but from Foo.prototype.

Javascript Function Invocation Patterns:

A method is a function as a property of an object. When a method is invoked, this is bound to the object. When a function (not an object method) is invoked with this pattern, this is bound to the global object, rather than the this variable of the outer function.

comments powered by Disqus