Fandom

Programmer's Wiki

Array Sort

407pages on
this wiki
Add New Page
Talk4 Share
function sort(arr) {
	arr.sort();
}

Example Javascript UsageEdit

arr = new Array('dog', 'cat', 'lion', 'tiger', 'bear');
sort(arr);
document.write(arr); /* Gives:  bear,cat,dog,lion,tiger  */

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.