how to compare string with any value in javascript code example
Example 1: string comparison in javascript
var str1 = "ab";
var str2 = "ab";
var n = str1.localeCompare(str2);
Example 2: javascript compare strings
console.log(NaN===NaN);//false
var str1 = "ab";
var str2 = "ab";
var n = str1.localeCompare(str2);
console.log(NaN===NaN);//false