JavaScript - Conditional Operator/Expression or Ternary Operator ( ? : )

Published: 25 January 2018
on channel: Christian Hur
85
0

The conditional expression or ternary operator is another way of writing an IF-ELSE block.

let result=null, a=1, b=1;

If-Else Block:

if (a==b)
result=true;
else
result=false;

Conditional Expression:

result = (a==b) ? true : false;


On this page of the site you can watch the video online JavaScript - Conditional Operator/Expression or Ternary Operator ( ? : ) with a duration of hours minute second in good quality, which was uploaded by the user Christian Hur 25 January 2018, share the link with friends and acquaintances, this video has already been watched 85 times on youtube and it was liked by 0 viewers. Enjoy your viewing!