How to solve turnury? operators | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to solve turnury? operators

3rd Apr 2018, 4:49 PM
Deepak badhe
Deepak badhe - avatar
4 Answers
+ 6
(condition) ? (do this if true) : (else do this if false); ^Basically, it's just simplifying your if/else block. Not appropriate for all situations, but for simple situations, it's nice to have around. Example: myResult = (myVar > 5) ? "myVar is greater than 5!" : "myVar is lesser than 5...";
3rd Apr 2018, 4:54 PM
Fata1 Err0r
Fata1 Err0r - avatar
+ 2
Hi Deepak I think you mean Ternary (as in third) which is often referred to as the conditional operator. This can be used to replace if then else statements https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Conditional_Operator
3rd Apr 2018, 5:12 PM
Mike Choy
Mike Choy - avatar
0
Bro phir wo 12:20:50 ya ratio ma kya rhta ha
3rd Apr 2018, 5:05 PM
Deepak badhe
Deepak badhe - avatar
0
Mike but my question is different
3rd Apr 2018, 5:14 PM
Deepak badhe
Deepak badhe - avatar