Context Binding
introduction to context binding, animation of a ball using the setInterval method
We'll cover the following...
In ES5, function scope often requires us to bind the context to a function. Context binding is usually performed in one of the following two ways:
- by defining a
self = this
variable, - by using the
bind
function.
In our first example, we will attempt to ...