Presentation comments ...
<details class="slides-small"> <summary>What is the order?</summary> Left: 1,2; Right: 2,1<br> </details>
FROM THE OLD REPO, NEED TO DELETE OR INTEGRATE ```js // callback example function log(answer) { console.log("The answer is " + answer); } function sum(n1, n2, callback) { // sum n1, n2 and invoke callback function callback(n1 + n2); } // pass a function as a callback sum(5, 5, log); // promise example function waitForPromise(param) { return new Promise(resolve => { setTimeout(() => { resolve(param); }, 2000); }); } // async function async function test() { let str = ""; // use await to wait for promise in synchronous code str += await waitForPromise("🤡"); console.log(str); str += await waitForPromise(" lurks"); console.log(str); str += await waitForPromise(" in the shadows"); console.log(str); } test(); ```