Created
March 22, 2023 14:28
-
-
Save periakteon/9d409309a24cf634e663a37df6956987 to your computer and use it in GitHub Desktop.
FreeCodeCamp: Use the Conditional (Ternary) Operator (Solution)
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
| function checkEqual(a, b) { | |
| // a == b ise, yani "a == b" true dönerse, "Equal" stringi döndür | |
| // else, yani diğer durumlarda, "Not equal" stringi döndür | |
| return a == b ? "Equal" : "Not Equal"; | |
| } | |
| console.log(checkEqual(1, 2)); | |
| // Not Equal | |
| console.log(checkEqual(5, 5)); | |
| // Equal |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment