var arr = [ [7, 6, 5], [17, 16, 15], ]; var arrSorted = []; for ( var i=0; i<arr.length; i++ ) { arrSorted.push( arr[i].sort( compNums ) ); } console.log( arrSorted ); function compNums( a, b ) { return a - b; }