Bare Minimum Requirements const sleep = (wait) => { return new Promise((resolve) => { setTimeout(() => { resolve('hello'); }, wait); }); }; function runPromise() { resetTitle(); playVideo(); sleep(1000) .then((param) => { console.log(param); pauseVideo(); displayTitle(); return "world"; }) .then((param) => { console.log(param); return sleep(5000); }) .then(highlightTitle) .then(sleep.bind(null, ..
Async & Promise, fs 모듈 과제
Bare Minimum Requirements const sleep = (wait) => { return new Promise((resolve) => { setTimeout(() => { resolve('hello'); }, wait); }); }; function runPromise() { resetTitle(); playVideo(); sleep(1000) .then((param) => { console.log(param); pauseVideo(); displayTitle(); return "world"; }) .then((param) => { console.log(param); return sleep(5000); }) .then(highlightTitle) .then(sleep.bind(null, ..
2023.01.18