Answers for "why sort is not working in javascript"

0

why sort is not working in javascript

function sort() {
        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];
        return ary.sort(function(a, b) {
          console.log(a,b,'rererererer')
          return a - b;
        });
}
    
alert(sort());
Posted by: Guest on June-25-2020

Code answers related to "why sort is not working in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language