Question 15
Consider the following JavaScript code.
function goUpDown(num) { return new Promise((res, rej) => { setTimeout(() => { if (num < 20) { return num > 10 ? res('Go Up') : res('Go Down') } else { return rej('Number Too Large') } }, 1000) })}
async function getData() { const data3 = await goUpDown(8) const data2 = await goUpDown(15) const data1 = await goUpDown(12)}getData().then( (data) => { console.log(data) }, (err) => { console.log(err) })What will be logged on to console, if executed?
Go Up
Go Down
Number Too Large
None of these.