You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// sort( sorts the elements of array and overwrites the orignal array)
// sort the elements as strings in alphabetical ascending order
// sort takes an optional compare function
letary=[11,44,33,2,12,66,];
letstr=["Akshay","Kshay","Shay","Hay","Ay","y"];//It will first convert each element of the array into a string then comparison happens based on their UTF-16 code and the order of comparison is ascending.