JSchallenger

Sort an array of strings alphabetically

Viewed: 382
Attempted: 187
Solved: 82
// Write a function that takes an array of strings as argument
// It should return the array with its values sorted alphabetically
//

function myFunction() {

return
}
Test Cases:
myFunction(['b', 'c', 'd', 'a'])
Expected
['a', 'b', 'c', 'd']
myFunction(['z', 'c', 'd', 'a', 'y', 'a', 'w'])
Expected
['a', 'a', 'c', 'd', 'w', 'y', 'z']