let array = [
[3, 1, 18, 4, 0],
[5, 1, 9, 32, 8],
[7, 21, 6, 2, 5]
];
// Function to sort each row
const sortedArray = array.map(row => row.slice().sort((a, b) => a - b));
console.log(sortedArray);
/*
Run:
[ [ 0, 1, 3, 4, 18 ], [ 1, 5, 8, 9, 32 ], [ 2, 5, 6, 7, 21 ] ]
*/