Using .match and the difference between .search
Sorry this is kind of a dumb question but I cant find it anywhere I used
this for coderbyte:
function VowelCount(str) {
// code goes here
return str.match(/[aeiou]/gi).length;
}
// keep this function call here
// to see how to enter arguments in JavaScript scroll down
print(VowelCount(readline()));
I understand most of it but what do the forward slashes and the square
brackets do. Also what does the gi do?
And what is the difference between .search and .match what condition
should I use what in?
No comments:
Post a Comment