I have the following object:
{
apple: 0,
banana: 0,
cherry: 0,
date: 0,
and so on...
}
And an array of strings that are words from a cookery book.
[0] => "the"
[1] => "apple"
[2] => "and"
[3] => "cherry"
and so on...
I would like to iterate over the array of strings and add +1 every time the above keys are mentioned as a string? I've been trying to use object.keys however have been unable to get it working?
This is in node.js.