7 kyu

Array.prototype.reverse()

2,682 of 2,701wthit56

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 Trained5177
Total Skips284
Total Code Submissions16268
Total Times Completed2701
JavaScript Completions2682
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