Is there a way to tally the occurrences of specific words from a list within a given set of phrases and store the count in designated variables?
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