JSON: Difference between revisions
m
→{{header|Sidef}}: updated code to use JSON::PP (which is a core module)
(→Insitux: inclusion) |
m (→{{header|Sidef}}: updated code to use JSON::PP (which is a core module)) |
||
Line 4,058:
=={{header|Sidef}}==
<syntaxhighlight lang="ruby">var json = require('JSON::PP').new
var data = json.decode('{"blue": [1, 2], "ocean": "water"}')
say data
data{:ocean} = Hash
say json.encode(data)
{{out}}
<pre>Hash
)
{"blue":[1,2],"ocean":{"water":["fishy","salty"]}}</pre>
|