Infosys interview question

Js basics