What type of sorted array will the output of this code snippet be?
let numbers = [5, 10, 30, 41, 100, 56];
numbers.sort((a,b) => {
if(a > b) return 1;
if(a < b) return -1;
return 0;
});
console.log(numbers);What type of sorted array will the output of this code snippet be?
let numbers = [5, 10, 30, 41, 100, 56];
numbers.sort((a,b) => {
if(a > b) return 1;
if(a < b) return -1;
return 0;
});
console.log(numbers);Create a free account to access the full topic