Skip to content

Latest commit

 

History

History

reverse-array-in-place

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Reverse array in place

Description

You will be given an array and your goal is to reverse it.

Implementation

reverseArrayInPlace(arr) should return the origin arr reversed.

There are some conditions:

  • be sure to manipulate the array passed in.
  • don't push elements into a new array and return that array.
  • don't use Array.reverse() method.

Example:

reverseArrayInPlace([1, 2, 6, 3, 5, 0]) // [0, 5, 3, 6, 2, 1]