Skip to content

Instantly share code, notes, and snippets.

View nlapier's full-sized avatar

Nathaniel LaPier nlapier

  • New York City
View GitHub Profile
@nlapier
nlapier / gist:eb394fe78ed28a25b1ed
Created February 11, 2016 22:41
Running solutions for Eloquent Javascript - comments are welcome!
/****************************
Chapter 4: Reversing an Array
*****************************
Arrays have a method reverse, which changes the array by inverting the order in which its elements appear.
For this exercise, write two functions, reverseArray and reverseArrayInPlace.
The first, reverseArray, takes an array as argument and produces a new array that has the same elements in the inverse order.
The second, reverseArrayInPlace, does what the reverse method does:
it modifies the array given as argument in order to reverse its elements. Neither may use the standard reverse method.
*/