21.) What happens if a promise is neither resolved nor rejected?
22.) Which of these is NOT a promise-based API?
23.) Which of the following is an example of a callback function?
setTimeout(function() {
console.log("Done!");
}, 1000);
24.) What is the output of the following code?
console.log("A");
setTimeout(() => console.log("B"), 0);
console.log("C");
25.) What will console.log output for the following?
const promise = new Promise((resolve, reject) => {
reject("Error!");
});
promise.then(console.log).catch(console.log);
26.) What will the output be for the following code?
async function test() {
return "Hello";
}
console.log(test());