Bootcamp
Search…
1.ICE.2: Timeout / High Card Redux

Timeout

Read this code. What order is the the console.logs going to be printed in?
1
const wowParagraph = document.createElement("p");
2
document.body.appendChild(wowParagraph);
3
​
4
console.log("1");
5
​
6
const doLater = () => {
7
console.log("2");
8
wowParagraph.innerText = `cool! ${Math.random()}`;
9
};
10
​
11
console.log("3");
12
​
13
const myNewMain = (event) => {
14
console.log("4");
15
​
16
setTimeout(doLater, 1000);
17
};
18
console.log("5");
19
​
20
wowParagraph.addEventListener("click", myNewMain);
21
console.log("6");
Copied!

High Card Redux

​Review and complete each other's High Card code.
Copy link