# IsNull()

Determines whether given object is null or not

```
IsNull( object=any );
```

**Returns:** boolean

# Arguments

| Argument | Type | Required | Description | Default |
|----------|------|----------|-------------|---------|
| object | any | Yes | Object for which you perform the null check. |  |

# Usage Notes

Always use scoped variable references with `isNull()`.

When a null argument shares a name with an outer-scoped variable, `isNull()` can return the wrong result / unexpected due to scope cascading:

```cfml
name = "default";

function greet( name ) {
    if ( isNull( name ) ) {
        writeOutput( "Hello stranger" );
    } else {
        writeOutput( "Hello #name#" );
    }
}

greet( javacast( "null", "" ) );
// Outputs: "Hello default" - found the outer variable, not the null argument!
```

Use scoped references to reliably check for null:

```cfml
if ( isNull( arguments.name ) ) { ... }
if ( isNull( local.result ) ) { ... }
if ( isNull( variables.config ) ) { ... }
```

Under default (partial) null support, a null in `local` or `variables` does not stop an unscoped lookup; the search continues through the remaining cascaded scopes. Adobe ColdFusion stops at the nearer-scope null. This is intentional in Lucee. See [Scope Cascading](../../guides/developing-with-lucee-server/scope.md) and [Null Handling in CFML](../../recipes/null-support.md).

# Examples

```1
v1="test";
writeDump(isnull(v1));//false
v2;//Defining empty variable or v2=nullValue();
writeDump(isnull(v2));//true
```







# Categories

[Decision logic](../../categories/decision.md)

# See Also

[IsDefined()](isdefined.md), [NullValue()](nullvalue.md), [StructKeyExists()](structkeyexists.md), [structKeyExists vs isNull vs ParameterExists vs isDefined vs elvis operator](../../recipes/null-checks-comparison.md), [Null Values in Structs and Arrays](../../recipes/null-structs-and-arrays.md), [Null Handling in CFML](../../recipes/null-support.md), [Scopes](../../guides/developing-with-lucee-server/scope.md)