配列から一致する単語をすべて検索しようとしていますが、.match
は未定義の関数を返します。あなたは間違ってmatch()を使用しているJS/Javascript:.matchは未定義の値を返します
var hashtags = [ '#hr', '#acc', '#sales' ];
var message = "hello there #hr #acc";
var filteredMessage = _.filter(message.split(' '), value => value.match(hashtags));
// suppose to return [ '#hr', '#acc' ]