Short method

-It used to short values in an array alphabetically or numerically.

-It will return number if a should before b.

-It will return number if a should be after b.

-It will return equal number if they are equal.

For example: var array =[1,12,21,2]

              array.sort(function(a,b){

              return b-a;

              });