I want explanarion of this riddle | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5

I want explanarion of this riddle

var MyNumbers = [ 3,6,11,5 ]; MyNumbers.sort(function(a,b) { return b - a; }); I kinda know what this is all about, but wondering whats values a and b here? whats going on with it

1st Jul 2019, 1:53 PM
Terkizas
Terkizas - avatar
4 Answers
+ 6
Check the "Numeric Sort" section: https://www.w3schools.com/js/js_array_sort.asp
1st Jul 2019, 3:36 PM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 1
I think the array will be sorted in descending order.
2nd Jul 2019, 2:18 AM
Sonic
Sonic - avatar
0
I think the code is incomplete.
1st Jul 2019, 2:54 PM
AB Koder
AB Koder - avatar
0
Abdurrahman it is completed, because this question appeared in Challenge
1st Jul 2019, 3:02 PM
Terkizas
Terkizas - avatar