Created
February 16, 2022 19:15
-
-
Save appoll/e194ebd2faa92842f768b30d630ed177 to your computer and use it in GitHub Desktop.
01-equality.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Uncomment the code between /* and */; | |
// Run the code; | |
// See what happens; | |
// Does it make sense? | |
// 1.0 | |
age = 18; | |
if (age == 18) { | |
console.log("1.0 Yes!"); | |
} else { | |
console.log("1.0 No!"); | |
} | |
// 1.1 | |
/* | |
age = 18; | |
if (age == "18"){ | |
console.log("1.1 Yes!"); | |
} else { | |
console.log("1.1 No!"); | |
} | |
*/ | |
// 1.2 | |
/* | |
age = 18; | |
if (age === "18"){ | |
console.log("1.2 Yes!"); | |
} else { | |
console.log("1.2 No!"); | |
} | |
*/ | |
// 1.3 | |
/* | |
age = 18; | |
age1 = "18"; | |
if (age == age1){ | |
console.log("1.3 Yes!"); | |
} else { | |
console.log("1.3 No!") | |
} | |
*/ | |
// 1.4 | |
/* | |
age = 18; | |
if (age = 20){ | |
console.log("1.3 Yes!"); | |
} else { | |
console.log("1.3 No!"); | |
} | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment