title: Javascript Happy Numbers not working
body: <p>Here I have a function that should take a number <code>n</code> into the <code>disHappy(n)</code>  to check if all<br>
  <code>n in [n-0</code>)  are happy.</p>
  
  <p><a href="http://en.wikipedia.org/wiki/Happy_number" rel="nofollow">Happy Numbers wikipedia</a></p>
  
  <p>If I only run <code>happyChecker(n)</code>, I can tell that 7 is happy, but <code>disHappy(n)</code> doesn't show it. It is as if it doesn't receive the true. I have used <code>console.log()'s</code> all over the place and happyChecker(n) shows a number that SHOULD return true. When I placed a <code>console.log()</code> above the <code>return true;</code> for <code>if(newNum===1)</code>, it showed that it branched into that branch but it just didn't seem to return the true.</p>
  
  <pre><code>  function happyChecker(n) {
       var arr = [];
       var newNum = 0;
       //here I split a number into a string then into an array of strings//
       num = n.toString().split("");
       for (var i = 0; i &lt; num.length; i++) {
           arr[i] = parseInt(num[i], 10);
       }
       //here I square each number then add it to newNum//
       for (var i = 0; i &lt; arr.length; i++) {
           newNum += Math.pow(arr[i], 2);
       }
       //here I noticed that all unhappy numbers eventually came into one of these three//
       //( and more) numbers, so I chose them to shorten the checking. A temporary solution for sure//       
       if (newNum === 58 || newNum === 4 || newNum == 37) {
           return false;
       }
  
       if (newNum === 1) {
  
           return true;
       } else {
           happyChecker(newNum);
       }
  
   }
  
   function disHappy(num) {
       for (j = num; j &gt; 0; j--) {
           if (happyChecker(j)) {
               console.log(j + " is a Happy Number. It's so happy!!!.");
           }
       }
    }
  </code></pre>