Quloi interview question

Program fir array in js