How to do case insensitive string comparison?

The simplest way to do it (if you’re not worried about special Unicode characters) is to call toUpperCase:

var areEqual = string1.toUpperCase() === string2.toUpperCase();

Leave a Comment