Consider the below-mentioned code snippet. What will be the output of the following code snippet?

async function getData() { 
	await Promise.reject("Error occurred"); 
	return "Data"; 
} 
getData() 
	.then(console.log) 
	.catch(console.error);

"Error occurred"

"Data"

Promise {<rejected>}

Promise {<resolved>: "Data"}

Verified Answer
Correct Option - a

To get all Infosys Certified JavaScript Developer Exam questions Join Telegram Group https://grateful.prepflix.in/infy-lex-pdfs

Telegram