+ 5

How this function works???

How this takes value of a, b? How this works var a = [33, 4, 1111, 222]; a.sort(); // Alphabetical order: 1111, 222, 33, 4 a.sort(function(a,b) { return a-b; }); a.sort(function(a,b) {return b-a});

12th Jan 2019, 2:32 PM
Prabhat Kumar Singh
Prabhat Kumar Singh - avatar
2 ответов
12th Jan 2019, 3:30 PM
Ulisses Cruz
Ulisses Cruz - avatar
+ 1
Thank you so much Ulisses Cruz
12th Jan 2019, 4:36 PM
Prabhat Kumar Singh
Prabhat Kumar Singh - avatar