문제 링크 : Count Prefixes of a Given String
/**
* @param {string[]} words
* @param {string} s
* @return {number}
*/
var countPrefixes = function(words, s) {
return words.filter(word => s.indexOf(word) === 0).length
};
/**
* @param {string[]} words
* @param {string} s
* @return {number}
*/
var countPrefixes = function(words, s) {
return words.filter(word => s.startsWith(word)).length
};