Tell us what’s happening:
hey guys,
I need someone to explain to me this line of code below!
return a === b ? 0 : a < b ? -1 : 1;
only this line above!
thanks
Your code so far
function alphabeticalOrder(arr) {
// Only change code below this line
return arr.sort()
// Only change code above this line
}
alphabeticalOrder(["a", "d", "c", "a", "z", "g"]);
Your browser information:
User Agent is: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0.
Challenge: Sort an Array Alphabetically using the sort Method