Advertisement
kstoyanov

05. Count String Occurrences

Jul 16th, 2020
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function solve(text, word) {
  2.   const result = text.split(' ').filter((w) => w === word);
  3.  
  4.   console.log(result.length);
  5. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement