AB
Size: a a a
AB
j
K
K
Q
const str = "213 112 213 213 12345 feef";
console.log(str.split('').filter(item => str[0] === item).length);
S
const str = "213 112 213 213 12345 feef";
console.log(str.split('').filter(item => str[0] === item).length);

j
K
j
K
j
AB
K
AB
K
j
K
AB
j
j