> 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/syntax_and_semantics/literals/nil.md).

# Nil

The `nil` type represents the absence of a value, and is considered undefined:

```ruby
nil
defined(nil)  # -> false
nil.class     # -> error, methods cannot be called on undefined values
nil.ref       # -> error, methods cannot be called on undefined values
```

The `nil` type has only one possible representation, `nil`.

Instead of an error or exception, an *undefined* value is represented by `nil`:

```ruby
Hash(){:key}    # -> nil
```
