Count Distinct Elements In Array Javascript Append W3schools