Xoriant interview question

Related to JS and Angular basic