I want to compare two strings in JavaScript to test if they are exactly the same. Which would be the best (fastest) way to do this?
Right now, I'm considering either
if(string1.localeCompare(string2) == 0) {}
or simply
if(string1 == string2)
Is there a better way do to this?