isNull

A convenient extension property to check if a nullable object is null.

This property serves as a more readable and fluent alternative to the standard this == null check. It enhances code clarity, especially within conditional expressions or when chaining calls.

Example:

val name: String? = null
if (name.isNull) {
println("Name is null.")
}
// Output: Name is null.

Return

true if the object is null, false otherwise.

See also