Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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());
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #sort #working #javascript
ADD COMMENT
Topic
Name
9+9 =