EXERCISE · AlgoCasts

Reverse integer

Given an integer, return an integer that is the reverse ordering of numbers.

4 testsAlgoCastsGPL-3.0exercise 03 of 26

Directions

Directions

Given an integer, return an integer that is the reverse ordering of numbers.

Examples#

JS
reverseInt(15) === 51reverseInt(981) === 189reverseInt(500) === 5reverseInt(-15) === -51reverseInt(-90) === -9

Try it first#

Copy the stub, make the 4 tests pass on your machine, then open the solution. The reveal is remembered per page in this browser.

JSexercises/reverseint/index.js
function reverseInt(n) {} module.exports = reverseInt;

See also