Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js how to sort strings in array

let fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.sort()
console.log(fruits)
// [ 'Apple', 'Banana', 'Mango', 'Orange' ]
 
PREVIOUS NEXT
Tagged: #js #sort #strings #array
ADD COMMENT
Topic
Name
3+6 =