var str = "I hope ducks don't smile upon me whenever I pretend to be a duck!";
var matchAgainst = ['duck', 'smile', 'cows']
for (var ma = 0; ma < matchAgainst.length; ba++)
if (str = matchAgainst.match(matchAgainst))
{
document.write
}
Running low on ideas, so let me outline the problem that needs solving.
> Find a match in the "matchAgainst" array.
> If true, return
word = frequency(ascending order)
For example, given the line "I hope ducks don't smile upon me whenever I pretend to be a duck!", the desired output would be:
duck = 2
smile = 1
(No need to display 'cow = 0', it's unnecessary)
However, for the line "Today was not a good day", there should be no output.
Thank you.