js compare strings code example
Example 1: compare strings js
const s1 = 'learn';
const s2 = 'today';
console.log(s1 === 'learn');
console.log(s1 === s2);
Example 2: js split string
var myString = "Hello World!";
var splitWords = myString.split(" ");
var hello = splitWords[splitWords.indexOf("Hello")];
Example 3: equal to or more than javascript
a >= b
a <= b
Example 4: javascript compare strings
console.log(NaN===NaN);
Example 5: string comparison in javascript
console.log("10" == "10");
console.log(parseInt(10) == 10);