how to sort list in js
snippet in javascript

how to sort list in js

user7835


var fruits = ["Banana", "Orange", "Apple", "Mango"];

fruits.sort();
 

how to sort list in js

user3874


var points = [40, 100, 1, 5, 25, 10];

points.sort(function(a, b){return a-b});