Integer Reversal Algorithm

Directions:Given an integer, return an integer that is the reverse ordering of numbers.Examples:reverseInt(19) === 91reverseInt(281) === 182reverseInt(300) === 3reverseInt(-15) === -51reverseInt(-70) === -7
function reverseInt(n) {
//Code goes here
}
Helpful String Methods
Partial Solution 1
Partial Solution 2
  • If the argument is positive, returns 1.
  • If the argument is negative, returns -1.
Final Solution

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store