How can I count how many times wordToCount are in the phrasesToCheck. And how to put this number to counter variable ?
let counter = [];
let wordToCount = ["tomato","cat"];
let phrasesToCheck = ['my cat like potatoes','cat like apple','my golden fish like tomato'];
counter[0] = 1; //tomato
counter[1] = 2; //cat