// ternary operator = a shortcut to if{} and else{} statements // helps to assign a variable based on a condition // condition ? codeIfTrue : codeIfFalse; let time = 9; let greeting = time < 12 ? "Good morning!" : "Good afternoon!"; console.log(greeting); let isStudent = false; let message = isStudent ? "You are a student" : "You are NOT a student"; console.log(message); let purchaseAmount = 99; let discount = purchaseAmount >= 100 ? 10 : 0; console.log(`Your total is $${purchaseAmount - purchaseAmount * (discount/100)}`);
This course im taking is missing a lesson on ternary operators... came here. you're a much better teacher. Subbing and checking out more videos. THANKS!
// ternary operator = a shortcut to if{} and else{} statements
// helps to assign a variable based on a condition
// condition ? codeIfTrue : codeIfFalse;
let time = 9;
let greeting = time < 12 ? "Good morning!" : "Good afternoon!";
console.log(greeting);
let isStudent = false;
let message = isStudent ? "You are a student" : "You are NOT a student";
console.log(message);
let purchaseAmount = 99;
let discount = purchaseAmount >= 100 ? 10 : 0;
console.log(`Your total is $${purchaseAmount - purchaseAmount * (discount/100)}`);
I got my first job today in programming thanks to your free courses. Love you bro!
Please where and how
congratulations
Congrats! How is it going?
This course im taking is missing a lesson on ternary operators... came here. you're a much better teacher. Subbing and checking out more videos. THANKS!
bro’s better than all of the bootcamps combined somehow
Have an exam soon and you are saving my life. Thank you so much bro
This is my seal. I have watched the entire video, understood it, and I can explain it in my own words, thus I have gained knowledge. This is my seal.
why so little view?
Thanks, bro. You're a real bro 💪
Your code visible problem .so, your code editor must be zoom .
bro waiting for your React videos
Daddy Brocode teaches me lots
First 2 hours army ⬇️
Legends never die, ofcourse "BroCode" dont die
Thank you
15/7/24 2:16am
Your videos are very helpful and your teaching style is superb. Thanks bro👊🏽
thanks for js course
Hey broo upload React Vedios also 😊
I’m on my second day.❤ Bro Code
THE ? CODE IS NOT WORKING