Created
June 4, 2018 11:59
-
-
Save LeeeeeeM/1fae7cc46a2bcbff429c7a1f7102dfa7 to your computer and use it in GitHub Desktop.
this::fn(arguments)为什么使用es7的::操作符
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
使用::和es5的bind&&call&&apply的区别。 | |
使用call bind apply 不是一种面向oo的编程方式,所以会导致什么问题呢? 无法链式调用,这就很蛋疼了。 | |
所以::操作符的一部分作用就是可以面向oo编程,可以链式调用。 | |
example | |
fn2.bind(fn1.bind(this, a1)(argu1))(argu2) 恶心不?很恶心 | |
this::fn1(argu1)::fn2(argu2) OK,链式调用。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment