title: Counting ocurrencies / frequency of given value in a array inside object in an array of objects
body: <p>im new to javascript and lets say i have an array of objects (books) like this:</p>
  <pre><code>let books = [{&quot;pubDate&quot;:&quot;2014&quot;, &quot;authors&quot;:[&quot;John&quot;,&quot;Bob&quot;,&quot;Tom&quot;], &quot;name&quot;:&quot;Book 1&quot;}, {&quot;pubDate&quot;:&quot;2020&quot;, &quot;authors&quot;:[&quot;Bob&quot;,&quot;Greg&quot;], &quot;name&quot;:&quot;Book 2&quot;}]
  let authorsFrequency = getFrequency(books);
  console.log(authorsFrequency) // expected result {&quot;Bob&quot;:2,&quot;Tom&quot;:1,&quot;Greg&quot;:1,&quot;John&quot;:1}
  </code></pre>
  <p>How could i properly build this getFrequency function? I've seen some similar questions like this one: <a href="https://stackoverflow.com/questions/5667888/counting-the-occurrences-frequency-of-array-elements">Counting the occurrences / frequency of array elements</a></p>
  <p>But not one as deep as my example.</p>
  <p>Results order doesn't matter, infact the fastest the better since i need to loop through 30.000 books.</p>
  <p>Thank you very much for your time.</p>