Medium
What will this code output?
1const promises = [2 Promise.resolve(1),3 Promise.reject(new Error('Failed')),4 Promise.resolve(3)5];67(async () => {8 try {9 const results = await Promise.all(10 promises.map(async p => {11 try {12 return await p;13 } catch (err) {14 return null;15 }16 })17 );18 console.log('Results:', results);19 } catch (err) {20 console.log('Caught:', err.message);21 }22})();