Reverse Integer Problem Leetcode Javascript