Pregunta de entrevista de Cognizant

One coding question and JavaScript concepts