• Mwa@thelemmy.club
    link
    fedilink
    English
    arrow-up
    1
    arrow-down
    1
    ·
    edit-2
    4 hours ago

    like what?
    plus i tend to use a search engine more often if i can find what i want.

    • jtrek@startrek.website
      link
      fedilink
      arrow-up
      3
      ·
      4 hours ago

      For counting letters in a word? That’s like a one line expression in Python or JavaScript (and other languages). JavaScript console is right there in your browser.

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