Can I use triple equals for JavaScript string comparison?
问题 This is an extremely basic question, I know, but I couldn't understand what's going on from Google and Stack Overflow. I looked here and here to learn how to compare strings in JavaScript. Neither mentioned triple equals ( === ) in their answers, and said that it's better to use your own function ( str1 < str2 ? -1 : str1 > str2 ). However, going through explanations about === in Stack Overflow (here and here), the answers contain string comparisons. From what I saw in those answers, === does