I encountered something similar to this in a codebase.
if varA !== varB {
// some code here...
}
Is that the same as
if varA! == varB {
// some code here...
}
which means that varA is force unwrapped?
In swift ==
means "Are these objects equal?". While ===
means "Are these objects the same object?".
The first is a value equality check. The second is a pointer equality check.
The negation of these are !=
and !==
respectively.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With