7 kyu

Array.prototype.reverse()

2,694 of 2,713wthit56

Description:

The Array's reverse() method has gone missing! Re-write it, quick-sharp!

When this method is called, it reverses the order of the items in the original array. Then then it returns that same, original array. No new arrays should need to be created to pass this kata.

Here's an example:

var input = [1, 2, 3, 4];
input.reverse(); // == [4, 3, 2, 1]  // returned by .reverse()
input;           // == [4, 3, 2, 1]  // items reordered in the original array
Arrays
Algorithms

Stats:

CreatedJul 1, 2014
PublishedJul 1, 2014
Warriors Trained5196
Total Skips285
Total Code Submissions16299
Total Times Completed2713
JavaScript Completions2694
CoffeeScript Completions13
Total Stars60
% of votes with a positive feedback rating87% of 337
Total "Very Satisfied" Votes265
Total "Somewhat Satisfied" Votes57
Total "Not Satisfied" Votes15
Ad
Contributors
  • wthit56 Avatar
  • xcthulhu Avatar
  • Javatlacati Avatar
  • Chrono79 Avatar
  • Voile Avatar
Ad