Find Index In Javascript Array Sort Strings In Lexicographic Order