string comparison in javascript

JavaScript
let string = "1";
let number = 1;
if (parseInt(string) === number){
  	// STRING AND NUMBER MATCHES
}
if (string == number){
  // STRING AND NUMBER MATCHES ALSO BECAUSE == instead of ===, means it won't compare datasets, only the content
}console.log(NaN===NaN);//falseconsole.log("10" == "10"); //True
console.log(parseInt(10) == 10); // True Best practice
Source

Also in JavaScript: