The effect is the same in practice, so I think you could say that they are interchangeable.
In a boolean context (for example, conditional), the expression evaluates to both true and false.
In ActionScript 3.0, the following values are evaluated as false:
- Lying
- Null
- 0
- NaN
- "" (empty line)
- undefined
- invalid
Everything else evaluates to true.
A reference to a custom instance of a class can be either null or not null.
So in this case:
if ( object == null )
, , null.
:
if ( !object )
object false, object - null. null, . , , . , , object null, . , , object null, .
, ; ; , false , null; , , null, null. .