The output is undefined. I am unable to see what is wrong with the code, it is probably something small.. any help? Input 123, expected output 321. 

```js
var reverse = function(x) {
  var stack = [];
  var number;
  for (var i = 0; i < x.length; i++) {
    stack.push(x);
  }

  while (stack.length > 0) {
    number += stack.pop();
  }

  return number;
};

console.log(reverse(123));
```