I have some old code that doesn't have any comments that is using javascript differently then how I've ever used it. The following is doing math on strings.
if ((toFind > nextOptionText) && (toFind < lookAheadOptionText))
I've found questions like this one - that basically states that "a" < "b":
how exactly do Javascript numeric comparison operators handle strings?
However in my example I have some special characters that it is comparing against. In my code the parameters from above are:
if (("A" > "+") && ("A" < ">EINFUHRUNG ZUM"))
This is equaling TRUE - For me in my case I need it to equal FALSE, but I'm not asking how to make it false, I really just want to understand what the developer that wrote this code was thinking and how does the above if statement work.
Obviously I'm also dealing with a foreign language (German) - I'm pretty sure that this code was written prior to the application becoming multi-lingual.
If there is other suggestions that I should look into, please let me know (i.e. like using the locale or doing a different type of comparison).