Skip to content

Instantly share code, notes, and snippets.

@yschen25
Created March 8, 2022 04:13
Show Gist options
  • Save yschen25/c6c6f95008d526b12e891c2ab9da5457 to your computer and use it in GitHub Desktop.
Save yschen25/c6c6f95008d526b12e891c2ab9da5457 to your computer and use it in GitHub Desktop.
for (let i = 0; i < arrLength; i++) {
if (map.has(arr[i])) {
map.set(arr[i], map.get(arr[i]) + 1);
} else {
map.set(arr[i], 1);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment