Count Occurrences Of Element In Array Javascript Append Html