Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var numbers = [4, 2, 5, 1, 3];
- numbers.sort(function(a, b) {
- return a - b;
- });
- console.log(numbers); // [1, 2, 3, 4, 5]
- // for (...) {
- var a = numbers[i];
- var b = numbers[i + 1];
- // }
- function(a, b) {
- return -123;
- }
Add Comment
Please, Sign In to add comment