1let string = "1";
2let number = 1;
3if (parseInt(string) === number){
4 // STRING AND NUMBER MATCHES
5}
6if (string == number){
7 // STRING AND NUMBER MATCHES ALSO BECAUSE == instead of ===, means it won't compare datasets, only the content
8}
1var string1 = "Hello World";
2var string2 = "Hello world.";
3if (string1 === string2) {
4 console.log("Matching strings!");
5}
6else {
7 console.log("Strings do not match");
8}
1console.log("10" == "10"); //True
2console.log(parseInt(10) == 10); // True Best practice