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
Similar Kata:
Stats:
Created | Jul 1, 2014 |
Published | Jul 1, 2014 |
Warriors Trained | 5177 |
Total Skips | 284 |
Total Code Submissions | 16268 |
Total Times Completed | 2701 |
JavaScript Completions | 2682 |
CoffeeScript Completions | 13 |
Total Stars | 60 |
% of votes with a positive feedback rating | 87% of 337 |
Total "Very Satisfied" Votes | 265 |
Total "Somewhat Satisfied" Votes | 57 |
Total "Not Satisfied" Votes | 15 |