Every line of 'mdn sort' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.
105 var arrsort = arr.sort(function sortNumber(a, b){ 106 return a - b; 107 });
Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code
83 function dsort(a) { 84 return [...a].sort(dSort) 85 }
9 function sort(a, b) { 10 return a.time - b.time 11 }
45 function sort(a, b) { 46 return a[1] - b[1]; 47 }
9 return function sort(a, b) { 10 // polyfills always first 11 if (a.names[0] === first) { 12 return -1; 13 } 14 // main always last 15 if (a.names[0] === last) { 16 return 1; 17 } 18 // vendor before app 19 if (a.names[0] !== first && b.names[0] === last) { 20 return -1; 21 } else { 22 return 1; 23 } 24 };
144 function sortNumber(a, b) { 145 return a - b; 146 }
93 function sortNumber(a,b) { 94 return a - b; 95 }
85 function sort(a, b) { 86 if (a === b) { 87 hasDuplicates = true; 88 return 0; 89 } 90 91 return 1; 92 }
1 export function sort(arr) { 2 return [...arr].sort((a, b) => a - b); 3 }
36 function ascSort( a, b ) { 37 38 return a.distance - b.distance; 39 40 }