Nimap infotech Interview Question

js tricky question , dsa in javascript.