How to reverse an array in javascript
•
1 min read
We’re lucky these days, there’s a native method to reverse an array in javascript:
const arr = [1, 4, 7]
arr.reverse() // [7, 4, 1]
We’re lucky these days, there’s a native method to reverse an array in javascript:
const arr = [1, 4, 7]
arr.reverse() // [7, 4, 1]