Comparision Operator
- Equal To (==)
- Not Equal (!=)
- Less than (<)
- Greater than (>)
- Less than or Equal to (<=)
- Greater than or Equal to (>=)
It reruns either true or false, it is used in if conditional statements.
Tubles comparision:
Left to right comparision, if first element same as second then only it goes for second element comparision.
Ternary Conditional Operator:
- Question ? answer1: answer 2
- Example answer = 2 < 5 ? true: false
Nil Coalescing Operator: (??)
- a ?? b
- It unwraps an optional a if it contains a value, or returns a default value bif a is nil.
- a is an optional type here
- b must match with the type that is stored inside a.
No comments:
Post a Comment