Skip to content

Instantly share code, notes, and snippets.

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 xudaolong/bf071d5ecd1a41c0ed55c2ea9e4fab27 to your computer and use it in GitHub Desktop.
Save xudaolong/bf071d5ecd1a41c0ed55c2ea9e4fab27 to your computer and use it in GitHub Desktop.
ES2016 地方|-|&tag=check
(
(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