Nagarro Interview Question

basic javascript and functional JS