Pregunta de entrevista de NIKE

Questions on React and Node JS. One coding problem (JavaScript)