EY interview question

basic JS, and angular