For example: I need to change a content of any element in my HTML in a asynchronous request, but the scope of this asynchronous request is somewhere I don´t know, so i use a bind prototyped function of a Function native object to change or set the scope for me like this:
1 2 3 4
.bind after the function, that instruction set my scope for execution of this function, the scope is
To do this, I stole the prototype function from a prototypeJS framework and adapted it for my needs.
You can also send more arguments for a function. In the
bind function, the first argument is a scope and the others are the function arguments. I can do so:
1 2 3 4 5