Skip to content

Latest commit

 

History

History
10 lines (6 loc) · 254 Bytes

sort.md

File metadata and controls

10 lines (6 loc) · 254 Bytes

Sorting an Array

The sort() method sorts the items of an array in a specific order (ascending or descending).

var city = ["California", "Barcelona", "Paris", "Kathmandu"];

var sortedArray = city.sort(); 

console.log(sortedArray);