js reverse nested array

Solutions on MaxInterview for js reverse nested array by the best coders in the world

showing results for - "js reverse nested array"
Samuel
17 Jan 2020
1var reversed = array.map(function reverse(item) {
2    return Array.isArray(item) && Array.isArray(item[0]) 
3               ? item.map(reverse) 
4               : item.reverse();
5});