This solution might sound redundent, but I will improve it later, since it is developed by myself totally,the key logic will be like

find out all the index of item in a array, then push those index number into a array, after that, calculate the lengh of the array to get the number of repeatition time appear in a array.

Array.prototype.indexOf()

JavaScript Array length

Remove duplicate values from JS array [duplicate]