Count Duplicate Element In Array Javascript Documentation