if - script and chart function

The if function returns a value depending on whether the condition provided with the function evaluates as True or False.

Syntax:  

if(condition , then , else)

 

The if function has three parameters, condition, then and else, which are all expressions. The two other ones, then and else, can be of any type.

Arguments:  

Argument Description
condition Expression that is interpreted logically.
then Expression that can be of any type. If the condition is True, then the if function returns the value of the then expression.
else Expression that can be of any type. If the condition is False, then the if function returns the value of the else expression.

Did this information help you?

Thanks for letting us know. Is there anything you'd like to tell us about this topic?

Can you tell us why it did not help you and how we can improve it?