Here's my solution using JavaScript. Should be pretty easy to follow. Basically, I keep calculating the sum of squares until I come across one that I've already seen. The nice thing about this approach is that it memoizes all values so if this were used on multiple numbers, in the event that during the process a previously seen number is encountered, an answer can immediately be given.

```
var isHappy = function(n) {
var seen = {};
while (n !== 1 && !seen[n]) {
seen[n] = true;
n = sumOfSquares(n);
}
return n === 1 ? true : false;
};
function sumOfSquares(numString) {
return numString.toString().split('').reduce(function(sum, num) {
return sum + Math.pow(num, 2);
}, 0);
}
```