node.js中是否有dojo.hitch等价物

Ram*_*mki 5 dojo node.js

我正在寻找一种函数来绑定函数的'this'.虽然编写一个很容易,但我想确保它在我编写或使用dojo中的那个之前不是node.js环境中任何流行模块的一部分.

Ray*_*nos 7

(function() {
  alert(this.toString());
}).bind(new String("Man ES5 is awesome.")).call();
Run Code Online (Sandbox Code Playgroud)

Function.prototype.bind[文档]

Node.js在V8上运行.V8完全符合ES5标准.