EY interview question

Basic javascript