JavaScript this binding
Posted on 2014-12-30
While reading articles this morning, I came across this one talking about anti-patterns.
Most of the things were small, but I learned about the thisArg
and the bind
function. They both prevent the use of var _this = this
in JavaScript anonymous functions.
Here is a sample for the bind
function.
Both are awesome for keeping code clean and simple.
comments powered by Disqus