title: Building adjacency matrix from an array of objects
body: <p>I have a plain JavaScript array of objects, say e.g.</p>
  
  <pre><code>const drawings = [
    {
      name: "Foo",
      category: "widget"
    },
    {
      name: "Bar",
      category: "widget"
    },
    {
      name: "Bar",
      category: "fidget"
    },
  ]
  </code></pre>
  
  <p>etc, where both the name and category have duplicates. What I want to end up with is essentially a list of objects (this is to meet the interface for a 3rd party library), where each object represents a name, and then for each category there is a property that is either true or false, depending on the original list. So for the example the output would be:</p>
  
  <pre><code>const output = [
    {
      name: "Foo",
      widget: true,
      fidget: false
    },
    {
    {
      name: "Bar",
      widget: true,
      fidget: true
    },
  ]
  </code></pre>