I am building an array as an object, which a function I'm writing will eventually crawl. It's static data, so once it's populated nothing is likely to be added or removed, but I'm having difficulty formatting it properly.
The variable declaration works great if I have only one record's worth of data:
var panel = {
'url':'http://www.minorworksoflydgate.net/Testament/Clopton/nw_test_1.html',
'x':[1.63, 3.53],
'y':[6.58, 7.26],
'z':[2.05, 2.81]
}
However, if I try to add a second record's worth of information:
var panel = {'0':['url':'http://www.minorworksoflydgate.net/Testament/Clopton/sw_test_1.html',
'x':[-9.38, -7.47],
'y':[6.80, 7.49],
'z':[-8.18, -8.85]],'1':[
'url':'http://www.minorworksoflydgate.net/Testament/Clopton/nw_test_1.html',
'x':[1.63, 3.53],
'y':[6.58, 7.26],
'z':[2.05, 2.81]}
}
I get the following error: SyntaxError: Unexpected token ':'. Expected either a closing ']' or a ',' following an array element. I've tried every combination I can think of: wrapping each hunk of data in braces or square brackets and both explicitly declaring the keys and not declaring the keys. It all results in variations of this error. Where am I messing up in terms of formatting this information?