Here is another way...
var reversed = num.toString().split('').reverse().join('');
jsFiddle.
If you wanted it again as a Number
, use parseInt(reversed, 10)
. Keep in mind though, leading 0
s are not significant in a decimal number, and you will lose them if you convert to Number
.