Search
 
SCRIPT & CODE EXAMPLE
 

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());
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript Short and Long date format 
Javascript :: what is == in js 
Javascript :: react native image zoom viewer 
Javascript :: product 
Javascript :: str into array 
Javascript :: import ipcrenderer in react 
Javascript :: get file extension of path extendscript 
Javascript :: When JavaScript was invented month?* 
Javascript :: test one function in react class 
Javascript :: js check if object key exists 
Javascript :: example of call by value and call by reference in javascript 
Javascript :: javascript substr 
Javascript :: good way to check object properties in js 
Javascript :: ckeditor ignore contenteditable 
Javascript :: ajax error slider revolution 
Javascript :: angular set attribute value dynamically 
Javascript :: find element that has certain text javascript 
Javascript :: javascript variables 
Javascript :: java script add fields dynamically 
Javascript :: length of array 
Javascript :: write hello world in javaskript 
Javascript :: select option in js dynamically 
Javascript :: Show Modal Dialog on Jetpack Compose 
Javascript :: how to find remainder in javascript 
Javascript :: moment js date between two dates 
Javascript :: javascript example 
Javascript :: adding event listener to multiple elements 
Javascript :: Jest DOM Manipulation 
Javascript :: ng-true-value 
Javascript :: is value in list javascript 
ADD CONTENT
Topic
Content
Source link
Name
6+8 =