Reverse a number without having to do any conversions!
To install, run npm install reverse-number --save
The following snippet shows just how easily you can reverse a number:
const reverse = require('reverse-number');
const my_number = 1234; // The number to be reversed
const my_number_reversed = reverse(my_number); // The reverse of your number
console.log(`${my_number} reversed is ${my_number_reversed}`); // Prints 1234 reversed is 4321
- Numbers must be positive
- Numbers must be less than Number.MAX_SAFE_INTEGER