Count apperance of character in an array:
let m = new Map();
for (const e of arr) {
m.set(e, (m.get(e) || 0) + 1)
}
Notes on using JS language
Count apperance of character in an array:
let m = new Map();
for (const e of arr) {
m.set(e, (m.get(e) || 0) + 1)
}