Skip to content

Instantly share code, notes, and snippets.

@periakteon
Created March 22, 2023 14:37
Show Gist options
  • Save periakteon/5c864155b895e50c658d7ba65f88c668 to your computer and use it in GitHub Desktop.
Save periakteon/5c864155b895e50c658d7ba65f88c668 to your computer and use it in GitHub Desktop.
FreeCodeCamp: Use Multiple Conditional (Ternary) Operators (Ex2)
function findGreaterOrEqual(a, b) {
// if gibi düşünelim
// " a === b " true döndüğünde, "a and b are equal" döndürür
return (a === b) ? "a and b are equal"
// else if gibi düşünelim
// " a > b " true döndüğünde, "a is greater" döndürür
: (a > b) ? "a is greater"
// else gibi düşünelim
// kalan tüm durumlarda "b is greater" döndürür
: "b is greater";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment