title: JavaScript Array to Set
body: <p>MSDN references JavaScript's <a href="https://msdn.microsoft.com/en-us/library/ie/dn251547(v=vs.94).aspx" rel="noreferrer">Set</a> collection abstraction. I've got an array of objects that I'd like to convert to a set so that I am able to remove (<code>.delete()</code>) various elements by name:</p>
  
  <pre><code>var array = [
      {name: "malcom", dogType: "four-legged"},
      {name: "peabody", dogType: "three-legged"},
      {name: "pablo", dogType: "two-legged"}
  ];
  </code></pre>
  
  <p>How do I convert this array to a set? More specifically, is it possible to do this without iterating over the above array? The documentation is relatively lacking (sufficient for instantiated sets; not for conversions - if possible).</p>
  
  <p>I may also be thinking of the conversion to a <a href="https://msdn.microsoft.com/en-us/library/ie/dn263029(v=vs.94).aspx" rel="noreferrer">Map</a>, for removal by key. What I am trying to accomplish is an iterable collection that can be accessed or modified via accessing the elements primarily via a key (as opposed to index). </p>
  
  <p>Conversion from an array to the other being the ultimate goal.</p>