js reverse nested array code example
Example: js reverse nested array
var reversed = array.map(function reverse(item) {
return Array.isArray(item) && Array.isArray(item[0])
? item.map(reverse)
: item.reverse();
});