Skip to content

2185-counting-words-with-a-given-prefix

DevGod
DevGod
Vtuber
/**
* @param {string[]} words
* @param {string} pref
* @return {number}
*/
var prefixCount = function(words, pref) {
return words.reduce( (sum,el)=>sum + el.startsWith(pref), 0);
};