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

An interview experience that made me so sad.

fatfish

--

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

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