Nagarro interview question

Javascript arrays and a problem to solve a array coding question.