Using a javascript object like a java Map?
<p>I need something of a HashMap in javascript. Can we do this:</p>

<pre><code>var map = {};
map['foo'] = true;
map['zoo'] = true;
...

if (map['foo']) {
    // yes, foo exists.
}
else {
    // no, foo does not exist.
}
</code></pre>

<p>how do we properly check for the existence of the property without inserting it if it does not exist? For example, I don't want map.foo to exist after the above check if I didn't explicitly add it,</p>

<p>Thanks</p>
