Skip to content

Instantly share code, notes, and snippets.

@LeeeeeeM
Created June 4, 2018 11:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LeeeeeeM/1fae7cc46a2bcbff429c7a1f7102dfa7 to your computer and use it in GitHub Desktop.
Save LeeeeeeM/1fae7cc46a2bcbff429c7a1f7102dfa7 to your computer and use it in GitHub Desktop.
this::fn(arguments)为什么使用es7的::操作符
使用::和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