title: How to determine if a number is odd or even in Java script
body: <p>Can anyone point me to some code to determine if a number in JavaScript is even or odd?</p>
  
  <p>I'm trying to do something like:</p>
  
  <pre><code>if(intellect is even)
  {
      var magic1 = intellect/2;
  }
  else
  {
      var magic1 = (intellect-1)/2
  }
  
  var magicdamage = Math.floor(Math.random) * (intellect + weaponi) + magic1
  </code></pre>