showing results for - "why sort is not working in javascript"
Silvana
23 Jan 2020
1function sort() {
2        var ary = [2, 1, 0.4, 2, 0.4, 0.2, 1.5, 1, 1.1, 1.3, 1.2, 0.2, 0.4, 0.9];
3        return ary.sort(function(a, b) {
4          console.log(a,b,'rererererer')
5          return a - b;
6        });
7}
8    
9alert(sort());
queries leading to this page
sortable function in js not workingwhy sort 28 29 wont sort in javascriptnodejs array sort not workingwhy sort is not working jssort doesn 27t work javascriptjavascript array sort not workingsort is not working in nodejswhy array sort method in javascript not sort arrayarray sort 28 29 not working javascriptsort does not sort arr jssortable js not workingsort method not working jswhy javascript sorting is not working sort not working javascriptwhy sort an array is not working jsjavascript sort not workingsort not working javascriptjavascript sort is not in orderjavascript sort not workingjs sort not sortjs sort not workingsort 3e not working javascriptsort on sort doesnt work js sort javascript it 3bs not functionarray sort javascript not workingsort not working with 3e javascript 24 28 29 sortable function in js not workingsort function in js doesn 27t work correctlyjs array sort not workingjavascript sort 28 29 not workingwhy sort function not work in jsjavascript sorting not workingsort not sorting javascriptjs sort function not workingjs sort function no workingjavascript sort is not workingjs sort not sorting array properlysort in javascript not workingsortablejs not workingsort array not workingangular array sort not workingarray sort not workingsort not working in jsjs array sort not workingjs sort do not sorksort javascript doesn 27t workwhy sort is not working in javascriptsort function not work jsjavascript sort 28 29 doesn 27t workjs sort not sortingsort not working in javascriptarray sort not working jsjs sort do not sortarray sort not working javascriptsort function not working javascriptarr sort 28 29 in js not workingsort js is not workjavascript sort method not workingjavascript array sort not workingarray sort is not workingsortby javascript not working properlywhy sort function is not working in jsarray sort not working javascriptsort fuction of javascript doesn 27t work in javascript sort is not working in javascriptarray sort not working javascript htmlwhy sort is not working in javascript