var data = [[3, 1], [1, 1], [5, 1], [6, 1], [25, 1], [8, 2], [2, 3]];
data = data.map(function(x){ // loop though all elements
return x.reverse(); // reverse each array
});
Arary.map should work on all modern browsers (by that I mean you need Chrome, Firefox, Safari, Opera, or IE9+).
EDIT: Since Array.reverse will mutate the array, you can also do this:
var data = [[3, 1], [1, 1], [5, 1], [6, 1], [25, 1], [8, 2], [2, 3]];
data.forEach(function(x){ // loop though all elements
x.reverse(); // reverse each array
});
Array.forEach works in the same "moden" browsers, that .map works in.