Infosys interview question

basis JavaScript and string array question