IBM Interview Question

Angular Basics find the occurence in array JS