Sitemap
JavaScript in Plain English

New JavaScript and Web Development content every day. Follow to join our 3.5M+ monthly readers.

Member-only story

“I Lost a Job Opportunity Just Because of Promise.all”

4 min readJul 28, 2022

--

Press enter or click to view image in full size

This is an interview experience that happened to my friend not long ago. The interviewer wanted him to implement the Promise.all function. Unfortunately, my friend didn't play well on the spot and couldn't answer the question.

After the interview, the interviewer rudely said to him: “Your foundation of JavaScript is not solid enough, and you have less-than-adequate knowledge of many JavaScript principles.”

I’m actually puzzled by this behaviour of the interviewer. Does the inability to implement Promise.all mean that the basics have not been mastered? That's strange, don't you think?

In what follows, I try to demystify Promise.all and other important Promise methods. So let’s get started.

1. Promise.all

From MDN:

“The Promise.all() method takes an iterable of promises as an input, and returns a single Promise that resolves to an array of the results of the input promises.

This returned promise will fulfill when all of the input’s promises have fulfilled, or if the input iterable contains no promises.

--

--

fatfish
fatfish

Written by fatfish

Hi friends, I am a front-end engineer from Alibaba, let’s code happily together.

JavaScript in Plain English
JavaScript in Plain English

Published in JavaScript in Plain English

New JavaScript and Web Development content every day. Follow to join our 3.5M+ monthly readers.