Joined October 2023
Photos and videos
Hello guys, I'm new in learning programming. I have been learning on my own. You can follow me and I will follow you back. We can help each other by solving and explaining JavaScript code. #CodeNewbie #webdev #javascript #developer
12
What is ternary Operator ? The ternary operator in JavaScript is also known as conditional Operator. It allows you to make decisions in a single line of code. For instance:- condition ? expression_if_true : expression_if_false #javascript #Coding #CodingJourney #Python
1
21
expression_if_false: This is the value or expression to be returned if the condition is false.
1
14
Here's an example that demonstrates the ternary operator: const age = 20; const message = age >= 18 ? "You're an adult" : "You're a minor"; console.log(message);
14