This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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. */ | |
function reverseArray(array) { | |
var newArray = []; |