title: Reverse a number without making it a string in Javascript
body: <p>Can anyone show me where I'm going wrong in my code please? I'm trying to reverse a number without changing it to a string. I've been searching google and looked through the previous questions asked about this topic and from what I can see my code mirrors the other answers. </p>
  
  <p>I've only been able to find code in Java, C, or C++ that do not use the to string method.</p>
  
  <p>In my attempts, when I run the code in the browser console it either gives me an answer of "Infinity" or crashes my browser. </p>
  
  <p>Here's my code...</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function reverseNumber(number) {
  
    var revNumber = 0;
  
    while (number &gt; 0) {
      revNumber = (revNumber * 10) + (number % 10);
      number = number / 10;
    }
  
    return revNumber;
  }
  
  console.log(reverseNumber(876));</code></pre>
  </div>
  </div>
  </p>
  
  <p>I know it must be some small syntax error but I just don't see it. Any insight would be appreciated. Thanks!</p>