Count Distinct Elements In Array Javascript Push Function In Js