About Lesson
Sort Array:
The sort() method is used to sort the array in place in a given order according to the compare() function. If the method is omitted then the array is sorted in ascending order.
Example:
var x = [“Ram”, “Arman”, “Raghav”, “Manav”];
x.sort();
Reverse Array:
The reverse() method is used for in-place reversal of the array. The first element of the array becomes the last element and vice versa.
Example:
var x = [“Ram”, “Arman”, “Raghav”, “Manav”];
x.reverse();
Exercise Files
No Attachment Found
Join the conversation