> For the complete documentation index, see [llms.txt](https://trizen.gitbook.io/sidef-lang/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://trizen.gitbook.io/sidef-lang/programming_tasks/u/undefined_values.md).

# Undefined values

Sidef variables are initialized with a default *nil* value, representing the absence of a value.

```ruby
var x      # declared, but not defined
x == nil   && say "nil value"
defined(x) || say "undefined"
 
# Give "x" some value
x = 42
 
defined(x) && say "defined"
 
# Change "x" back to `nil`
x = nil
 
defined(x) || say "undefined"
```

#### Output:

```
nil value
undefined
defined
undefined
```
