To reverse a number in JavaScript, do this:
parseInt(number.toString().split('').reverse().join(''))
.Here's how you do it:
const number = 123;
const reversed = parseInt(number.toString().split('').reverse().join(''));
console.log(reversed); // 321