Mimicking sets in JavaScript?
<p>I'm working in JavaScript. I'd like to store a list of <em>unique</em>, unordered values, with the following properties:</p>

<ol>
<li>a fast way to ask 'is A in the list'?</li>
<li>a fast way to do 'delete A from the list if it exists in the list'</li>
<li>a fast way to do 'add A to the list if it is not already present'.</li>
</ol>

<p>What I really want is a set. Any suggestions for the best way to mimic a set in JavaScript?</p>

<p>This <a href="http://stackoverflow.com/questions/5657219/set-of-objects-in-javascript">question recommends using an Object</a>, with the keys storing properties, and the values all set to true: is that a sensible way?</p>

<p>Thanks for your help. </p>

<p>UPDATE: sorry for not being clearer, the values I'd like to store are strings.</p>
