Answers for "indexof all occurrences javascript"

0

indexof all occurrences javascript

function countOccurences(string, word) {
   return string.split(word).length - 1;
}
var text="We went down to the stall, then down to the river."; 
var count=countOccurences(text,"down"); // 2
Posted by: Guest on August-22-2021

Code answers related to "indexof all occurrences javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language