【发布时间】:2014-03-12 05:26:52
【问题描述】:
在this melonJS tutorial 之后,我对这个回调的几种使用方式感到困惑(向下滚动到第 2 部分:加载我们的关卡,您将看到完整的代码)
// Set a callback to run when loading is complete.
me.loader.onload = this.loaded.bind(this);
我读过this tutorial on callbacks,所以我明白它们的用途……但我不明白。它说this.loaded.bind(this)
1) 第一个和第二个this 语句有什么区别
2) 做什么bind 和传递(this) 做什么?
谢谢
【问题讨论】:
标签: javascript callback bind melonjs