Skip to content

Latest commit

 

History

History
20 lines (13 loc) · 459 Bytes

File metadata and controls

20 lines (13 loc) · 459 Bytes

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]