Conditional statements are used to perform different actions based on different conditions.
if — Execute if condition is trueif...else — Execute if/elseelse if — Multiple conditionsswitch — Match value against casescondition ? true : falsevalue ?? defaultValueobj?.propEdit the code below and click Run to see the result live.