Ways to create a Set in JavaScript?
<p>In Eloquent JavaScript, Chapter 4, a set of values is created by creating an object and storing the values as property names, assigning arbitrary values (e.g. true) as property values. To check if the value is already contained in the set, the <code>in</code> operator is used:</p>

<pre><code>var set = {};

if (!'Tom' in set) { 
  var.Tom = true;
}
</code></pre>

<p>Is this idiomatic JavaScript? Wouldn't be using an array even better?</p>

<pre><code>var set = [];

if (!'Tom' in set) { 
  set.push = 'Tom';
}
</code></pre>
