The ternary operator, or conditional operator, takes three arguments and is basically a shortened way of writing an if-else statement.
Code:
🔗 http://codepen.io/beaucarnes/pen/oBbegb?editors=0012
More info:
🔗 https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Conditional_Operator
Beau Carnes on Twitter: https://twitter.com/carnesbeau
⭐JavaScript Playlists⭐
▶JavaScript Basics: https://www.youtube.com/playlist?list=PLWKjhJtqVAbk2qRZtWSzCIN38JC_NdhW5
▶ES6: https://www.youtube.com/playlist?list=PLWKjhJtqVAbljtmmeS0c-CEl2LdE-eR_F
▶Design Patterns: https://www.youtube.com/playlist?list=PLWKjhJtqVAbnZtkAI3BqcYxKnfWn_C704
▶Data Structures and Algorithms: https://www.youtube.com/playlist?list=PLWKjhJtqVAbkso-IbgiiP48n-O-JQA9PJ
▶Clean Code: https://www.youtube.com/playlist?list=PLWKjhJtqVAbkK24EaPurzMq0-kw5U9pJh
–
We’re busy people who learn to code, then practice by building projects for nonprofits. Learn Full-stack JavaScript, build a portfolio, and get great references with our open source community.
Join our community at https://freecodecamp.com
Follow us on twitter: https://twitter.com/freecodecamp
Like us on Facebook: https://www.facebook.com/freecodecamp
Follow Quincy on Quora: https://www.quora.com/Quincy-Larson
source
Emotional Shahada! Brother Accepts Islam!
https://www.youtube.com/watch?v=hvQ9biPlbos
LGBT Students Question Purpose of Life
https://youtu.be/E-KW9tUETN4
Will She Accept Islam? David Wood's Gift to Islam
https://youtu.be/iadevN2Zcqw
Japanese Sister Embraces Islam
https://youtu.be/9GOCsztZ7vI
Mexican Sister Accepts Islam –
https://youtu.be/Ko4q5dWEqdo
Baptist Christian Finds the Truth
https://youtu.be/7DUTk0P2lyo
Is Jesus the Master of Muhammad – Surprise Ending
https://youtu.be/Jxs1UZjEyPs
beautiful, thank you
Thank you for this! 😀
thank you very helpful
I had a ternary operator quiz that was embedded in another ternary operator and couldn't figure out what was happening. Until I met Beau. Thanks a lot.
1k likes baby i feel honored love you fcc
anyone else freaked out at how quickly he typed "You are an adult" and "You are a kid"?
Bien
what is the difference between ternary operator and if/else statement? which one is faster, suitable and apprioripate in which situation?? can you explain. thank you in advance.
Nested ternaries are wak yo. At that point we should be looking at switch statements. Right? Still learning…
If else's Suuuuuuuuck! So hard to read 10 curlies.
Thank you, direct to the point!
Thank you so much!
my guy can type
can anyone tell what is meant by three operand ?
what is the purpose of creating stop variable???
Please answer my question, my course is at progress.
I am using Codecademy Pro and this was a bit confusing in the lesson. This video explains it absolutely perfect. I understand the syntax and how it works. Thank you!
This helped me a lot. Thanks Beau!
in 4 minutes you explained everything. wooow Thank you
age >= 18
:p
why fcc videos so little views? should have at least 50k views in my book
that thumbnail is hilarious lol
Thank you! You are a JS Sensei!
Thanks a lot, Beau 🙂
😘😘😘😘😘😘😘😘😘😘😘
nice video what if firstcheck = true and secondcheck = true please explain
good example thanks bro