DEV Community

Djilou
Djilou

Posted on

A little challenge in JavaScript (will be glad to read your solutions)

Let's do a little challenge in JavaScript
Write a function that takes two parameters
-a string
-a phrase
and returns how many times this passed string occurred in the phrase

function occurences(str,phrase){
//returns how many times str occured in phrase (number)
}

answer in the comments i'll be reading each one of them

Top comments (0)