Luxoft interview question

Basic JS