Created
May 24, 2018 01:02
-
-
Save crongro/d737480fa02d10dfff577c4ca7005632 to your computer and use it in GitHub Desktop.
debugging test
This file contains hidden or 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
//2초뒤에 'codesquad'가 출력되도록 코드를수정하세요. (출력은 printMyname을 통해서 할 수 있음) | |
//(a,b객체를 직접 부를 수 없음. bind,call 등을 사용해야 함) | |
const a = { | |
run() { | |
setTimeout( ()=> { | |
const name = this.getName(); | |
},1000); | |
} | |
} | |
const b = { | |
start(printMyname) { | |
setTimeout(function(){ | |
a.run(); | |
},1000); | |
}, | |
getName() { | |
return 'codesquad' | |
} | |
} | |
const printMyname = (name) => console.log(name); | |
b.start(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment