callback
넘길 수 있는 실행가능한 코드 조각
원하는 시간이나 조건에 그 코드 조각이 실행되기 원할때
var callback = function() {
alert('callback was executed!');
}
setTimeout(callback, 5000);
setTimeout(function(){
alert('callback was executed!');
}, 5000);
popup
alert('hello world');
prompt('hello world');
confirm('hello world');
//advanced popup
console.log(prompt('What\'s your name?'));
if (confirm('Pop-up another one?')) {
alert('Pop-up from alert command!');
}
'Web > Typescript' 카테고리의 다른 글
class (0) | 2017.03.22 |
---|---|
Interface (0) | 2017.03.22 |
오브젝트 (Object) (0) | 2017.03.22 |
반복문 (Loops) (0) | 2017.03.21 |
조건문 (conditions) (0) | 2017.03.21 |