Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×

[Question] Using namespaces and arrays?

Hi! I'm going nuts on how to use namespaces and arrays. Just having the two lines below in a script gives me an "Unexpected token ]" error. var newchar = newchar || {}; newchar.attributes[]; After i've scratched my head for a while I found other scripts (Malikai's and Big Mike's character sheet generator) that uses the exact same concept. Should I just let my head implode or do you have any tips or suggestions? Regards from a new roll20 fan!
1395517736
Lithl
Pro
Sheet Author
API Scripter
The second line is the one causing the problem. Use newchar.attributes = []; instead.
Thanks Brian! I'm just blind and stupid and a derp :)