How to Reverse Arrays in JavaScript Without Using .reverse()

In-Place & Out-of-Place

Joe Cardillo
Aug 31, 2018 · 6 min read

A typical JavaScript challenge or interview question has to do with reversing arrays in-place and out-of-place. Specifically, take this problem from Eloquent JavaScript, 2nd Edition:

Write two functions reverseArray and reverseArrayInPlace. The first, reverseArray, takes an array as an argument…

Keep the story going. Sign up for an extra free read.

You've completed your member preview for this month, but when you sign up for a free Medium account, you get one more story.
Already have an account? Sign in

Joe Cardillo

Written by

Linux Customer Support @linode. Writing about Web Development, Programming, Computer Science, and other things that catch my attention.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade