Javascript - print the name of an enum from a value
<p>Is there a way I can print the values of the enum field given the int value? for example I have the following enum:</p>

<pre><code>refractiveIndex = {"vacuum": 1, "air": 1.000293, "water": 1.33, "diamond": 2.419};
</code></pre>

<p>If I have a value, is there a way to print the name of the enum.  For example lets say I have a variable set to 1 and I want to print out "vacuum", how do I do that:</p>

<pre><code>var value = 1;
console.log(refractiveIndex(value)); // Should print "vacuum" to console
</code></pre>

<p>?</p>