Created
April 16, 2017 18:00
-
-
Save theharveyz/e8d21758d27d2ba4d2f013179a280a6f to your computer and use it in GitHub Desktop.
js函数的方法(跟Go的任何类型都可以有method,非常像)
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
const func = func = (...args) => {func.info(...args)}; | |
func.info = (...args) => {console.info.apply(this, args)}; | |
// test | |
func(1,2,3,4); | |
// out put: | |
// ø 1 2 3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment