How create enum in javascript
<p>I need create named constant.</p>

<p>for example:</p>

<pre><code>NAME_FIELD: {
            CAR : "car", 
            COLOR: "color"}
</code></pre>

<p>using:</p>

<pre><code>var temp = NAME_FIELD.CAR // valid
var temp2 = NAME_FIELD.CAR2 // throw exception
</code></pre>

<p>most of all I need to make this enum caused error if the key is not valid</p>
