const countOfT = (word) => word.split('').filter(i => i === 't').length
countOfT('colonialism')
0
countOfT('this is an example sentence')
2
There's probably a more elegant way to do it.
const countOfT = (word) => word.split('').filter(i => i === 't').length
countOfT('colonialism')
0
countOfT('this is an example sentence')
2
There's probably a more elegant way to do it.