Python Count Number Of Occurrences In Array In Js