Command Shift

Reverse digits

54321

Expected Behaviour

When numberToReversedDigits is passed a number, it should return a reversed array of that number's digits.

E.g.

12345

becomes

[5, 4, 3, 2, 1]

Assertion

  • returns a reversed array of the number's digits

Run tests

 
npm run test -- numberToReversedDigits

On this page