how to sort words alphabetically in javascript