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 .
×
Create a free account

[API SCRIPT] Invalid shorthand property initializer error

September 09 (6 years ago)

I have a new script I'm trying to test but it's giving me a "SyntaxError: Invalid shorthand property initializer" error. I've looked through all my code but I must be overlooking something. Barring a post of the whole script, does anyone offhand have a more precise idea what this could mean? Online syntax checkers show nothing that would break the script.

September 09 (6 years ago)
The Aaron
Pro
API Scripter

Look at this: https://stackoverflow.com/questions/42006503/invalid-shorthand-property-initializer

Probably you have an = instead of a : somewhere in an object initializer.



September 09 (6 years ago)

That did it! Thanks! I was scanning all of my more complex code and didn't notice that at the top. Granted it's been too long since I've coded I'm still a little rusty. :/

I guess I need more coffee...

September 09 (6 years ago)
The Aaron
Pro
API Scripter

Definitely!  I always limit myself to only 1-2 pots of coffee a day... =D

Glad you got it working!