Valid JS-Dev-101 Dumps shared by EduDump.com for Helping Passing JS-Dev-101 Exam! EduDump.com now offer the newest JS-Dev-101 exam dumps, the EduDump.com JS-Dev-101 exam questions have been updated and answers have been corrected get the newest EduDump.com JS-Dev-101 dumps with Test Engine here:
Refer to the code: 01 const exec = (item, delay) => 02 new Promise(resolve => setTimeout(() => resolve(item), delay)); 03 04 async function runParallel() { 05 const [result1, result2, result3] = await Promise.all( 06 [exec('x', '100'), exec('y', '500'), exec('z', '100')] 07 ); 08 return `parallel is done: ${result1}${result2}${result3}`; 09 } Which two statements correctly execute runParallel()?
Correct Answer: B,D
________________________________________ Comprehensive and Detailed Explanation From Exact Extract JavaScript Knowledge Facts about JavaScript Promises: runParallel() is declared async, which means it always returns a Promise. Promises are consumed using .then(), .catch(), and .finally(). There is no .done() method in native JavaScript Promises. The async keyword cannot be placed before a function call (option A is invalid syntax). Analysis of each option: A . async runParallel().then(data); Invalid syntax. async cannot prefix an expression. B . Valid. Calls the function and attaches a .then() handler. C . Invalid. .done() is not part of JavaScript Promise API. D . Valid. Calls runParallel() and chains .then(). Therefore the correct answers are B and D. ________________________________________ JavaScript Knowledge Reference (text-only) async functions return Promises. Promises use .then() to retrieve resolved values. .done() is not part of the standard Promise interface.