Excuse me for a dumb question, I am very very new to JS but does it mean that comparison is performed not against the number of letters in a word but for the word content, so word “aaa” would be “smaller” than “aab”?
I’m referring to this:
if the current element is less than (alphabetically before) the element you're searching for, increase the lowIndex to one more than the midIndex
var arr = ["aaa", "aza", "aab", "aa", "ab"];
arr.sort(); //returns ["aa", "aaa", "aab", "ab", "aza"]
We’re a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.