ValueLabs interview question

I coding question on JS arrays