you are viewing a single comment's thread
view the rest of the comments
[–] 3 points 3 months ago* (1 child)

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.

  • source
  • parent
  • hideshow 1 child comment