> 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/j/json.md).

# JSON

```ruby
var json = require('JSON::PP').new
var data = json.decode('{"blue": [1, 2], "ocean": "water"}')
say data
data{:ocean} = Hash(water => %w[fishy salty])
say json.encode(data)
```

#### Output:

```
Hash(
    "blue" => [1, 2],
    "ocean" => "water"
)
{"ocean":{"water":["fishy","salty"]},"blue":[1,2]}
```
