Foreach Javascript Array Sort Alphabetically Python