Javascript case insensitive string comparison
snippet in javascript

Javascript case insensitive string comparison

user5566

var name1 = "Taylor Johnson";
var name2 ="taylor johnson";

//convert to lowercase for case insensitive comparison
if(name1.toLowerCase() === name2.toLowerCase()){
    //names are the same
}