title: Passing enum to function not working
body: <p>I'm trying to pass an enum to a function, but keep getting an 'undefined' error.</p>
  
  <p>If I try this:</p>
  
  <pre><code>var myVar = new myFunc('{ first:1, second:2 }')
  </code></pre>
  
  <p>and then</p>
  
  <pre><code>    function myFunc(enum) {
      var myEnum = enum;
      }
  </code></pre>
  
  <p>I find that <code>myEnum</code> is defined as <code>{ first:1, second:2 }</code>
  but <code>myEnum.second</code> is undefined.</p>
  
  <p>If I hard-code the same values directly into the <code>myEnum =</code> it works.</p>
  
  <p>I also tried putting the braces on the <code>myEnum =</code>  line instead, but no change.</p>
  
  <p>What am I doing wrong? Have I simply passed a string to <code>myEnum</code>?</p>
  
  <p>If so, how can I ensure that <code>myEnum</code> is indeed an enum?</p>