JavaScript program to enter a number and print its reverse code example
Example: reverse number javascript
// Function to reverse Number
function reverseNum(n) {
let r = n.toString().split('').reverse().join('');
return Math.sign(n) * parseInt(r);
}
// Call
reverseNum(-267);
reverseNum(31522);
// Outputs
-762
22513