title: Converting enums to array of values (Putting all JSON values in an array)
body: <p>I use this method <a href="https://stackoverflow.com/questions/287903/enums-in-javascript">Enums in JavaScript?</a> to create enums in our code..</p>
  
  <p>So </p>
  
  <pre><code>var types = {
    "WHITE" : 0,
    "BLACK" : 1
  }
  </code></pre>
  
  <p>Now the issue is when I want create validations anywhere, I have to do this;</p>
  
  <pre><code>model.validate("typesColumn", [ types.WHITE, types.BLACK ]);
  </code></pre>
  
  <p>Now is there a way I can just simple convert the values in types to an array so that I don't have to list all of the values of the enum?</p>
  
  <pre><code>model.validate("typesColumn", types.ValuesInArray]);
  </code></pre>
  
  <p><strong>EDIT</strong>: I created a very simple enum library to generate simple enums <code>npm --save-dev install simple-enum</code> (<a href="https://www.npmjs.com/package/simple-enum" rel="noreferrer">https://www.npmjs.com/package/simple-enum</a>)</p>