Last active
May 9, 2018 13:10
-
-
Save xudaolong/bf071d5ecd1a41c0ed55c2ea9e4fab27 to your computer and use it in GitHub Desktop.
ES2016 地方|-|&tag=check
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
( | |
(name,msg) => console.log(name,msg) | |
)("dragon","hello,bird"); | |
( | |
name => console.log(name) | |
)("dragon"); | |
let cat = { | |
name:"tom", | |
speak(msg,cb){ | |
cb(msg); | |
}, | |
hear(){ | |
this.speak("tom",()=>{ | |
console.log("my name",this.name) | |
}); | |
}, | |
hear2(){ | |
let that = this; | |
this.speak("tom",function(){ | |
console.log("my name",that.name) | |
}); | |
} | |
} | |
cat.hear(); | |
cat.hear2(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment