Skip to content

Commit 81cac2d

Browse files
committed
🐛 fixed decoding example (attempt to index global 'o' (a nil value))
1 parent d10400a commit 81cac2d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ json = require('json')
1515
print(json.encode({ 1, 2, 'fred', {first='mars',second='venus',third='earth'} }))
1616
```
1717
```json
18-
[1,2,"fred", {"first":"mars","second":"venus","third":"earth"}]
18+
[1,2,"fred", {"first":"mars","second":"venus","third":"earth"}]
1919
```
2020

2121
## Decoding ##
@@ -26,7 +26,7 @@ testString = [[ { "one":1 , "two":2, "primes":[2,3,5,7] } ]]
2626
decoded = json.decode(testString)
2727
table.foreach(decoded, print)
2828
print ("Primes are:")
29-
table.foreach(o.primes,print)
29+
table.foreach(decoded.primes,print)
3030
```
3131
```
3232
one 1

0 commit comments

Comments
 (0)