2024-06-12 11:46:11 +02:00
|
|
|
print({})
|
|
|
|
print({'key': 'value'})
|
|
|
|
print({'key': 'value', 'other': 'thing'})
|
|
|
|
print({'key': {'otherKey': 'value'}})
|
2024-06-07 11:37:53 +02:00
|
|
|
|
2024-11-18 14:38:25 +01:00
|
|
|
// We support non-string keys... in the HogVM.
|
|
|
|
// Keys are always converted to a string in the transpiled JS version.
|
|
|
|
// TODO: this might be worth revisiting
|
|
|
|
let key := 'kk'
|
2024-06-12 11:46:11 +02:00
|
|
|
print({key: 'value'})
|
2024-06-07 11:37:53 +02:00
|
|
|
|
2024-06-20 16:05:15 +02:00
|
|
|
print({'key': 'value', }.key)
|
2024-06-12 11:46:11 +02:00
|
|
|
print({'key': 'value'}['key'])
|
|
|
|
print({'key': {'otherKey': 'value'}}.key.otherKey)
|
2024-06-20 16:05:15 +02:00
|
|
|
print({'key': {'otherKey': 'value', } , }['key'].otherKey)
|