I am looking for a function that kind bind the 'this' of a function. Although it is easy to write one, I want to be sure that it is not part of any popular module in node.js environment before I write or use the one from dojo.
dojo/_base/lang — The Dojo Toolkit - Reference Guide. hitch() returns a function that will execute a given function in a given context. This function allows you to control how a function executes, particularly in asynchronous operations.
Node.js allows you to run JavaScript on the server.
(function() {
alert(this.toString());
}).bind(new String("Man ES5 is awesome.")).call();
Function.prototype.bind
[docs]
Node.js runs on V8. V8 is fully ES5 compliant.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With