compare strings js code example
Example 1: compare strings js
const s1 = 'learn';
const s2 = 'today';
console.log(s1 === 'learn'); // true
console.log(s1 === s2); // false
Example 2: javascript compare strings
console.log(NaN===NaN);//false
Example 3: string comparison in javascript
console.log("10" == "10"); //True
console.log(parseInt(10) == 10); // True Best practice