sort the array value in javascript sort() method

     Javascript array sort() method reverses the element of an array. The first array element becomes the last and the last becomes the first.
reverse() in javascript
How to sort/reverse some number in array

Note:
 Remember, by default array.sort(), sorts its elements in lexicographical order.

Syntax

  myarray.sort();

Example Program:- (Editor)


Editor is Loading...

Advertisement






Tag:
sort() method in javascript, how to sort a array using javascript, sorting array value.

0 nhận xét:

Đăng nhận xét