Ad
Code
Diff
  • const countLetterInSentence = (sentence, letter) => ([...sentence].filter(test => letter === test).length)
    
    function countLettersInSentence(sentence, letters){
      return letters.map(letter => countLetterInSentence(sentence, letter))
    }
    • function testAmount(sentence, letters){
    • return letters.map(letter =>
    • [...sentence].filter(test => letter === test).length)
    • const countLetterInSentence = (sentence, letter) => ([...sentence].filter(test => letter === test).length)
    • function countLettersInSentence(sentence, letters){
    • return letters.map(letter => countLetterInSentence(sentence, letter))
    • }