Adam Cameron
st = {}
[
"tahi",
"rua",
"toru",
"wha"
].each((n) => writeOutput(n))
Errors with: Invalid Syntax Closing []] not found on line 5
st = {}; // <--- say hello to my little friend
[
"tahi",
"rua",
"toru",
"wha"
].each((n) => writeOutput(n))
Works fine
😐zackster
10/28/2022, 5:05 PMAdam Cameron
David Rogers
10/30/2022, 10:43 PMst = {}["tahi"]; // key tahi doesn't exist
st = {}["tahi", "rua"]; // not a valid bracket access expression
st = {tahi: 42}["tahi"]; // ok
which is maybe not too unreasonableAdam Cameron
st = {}
[
"tahi",
"rua",
"toru",
"wha"
]
Adam Cameron
Invalid Syntax Closing []] not found on line 5
/ Context validation error for the cfscript tag. on line 1
respectively.
There's obvs some syntax in JS I don't know about. This is interesting:
> st = {
"tahi" : 1,
"wha" : 4
}
[
"tahi",
"rua",
"toru",
"wha"
]
<- 4
Adam Cameron
Adam Cameron
> st = {
"tahi" : "one",
"rua" : "two",
"toru" : "three",
"wha" : "four"
}
[
"toru",
"rua"
]
<- 'two'
Adam Cameron