JSchallenger

Sort an array of strings alphabetically

Viewed: 2302
Attempted: 2227
Solved: 745
// 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']