• jtrek@startrek.website
    link
    fedilink
    arrow-up
    3
    ·
    edit-2
    2 hours ago
    
    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.