// how to reverse number in javascript let number = 12345; let reverse = parseInt(number.toString().split('').reverse().join('')); console.log(reverse); // Output: // 54321