Forum Discussion
Javascript not activating in Storyline-(showing only default value)
I was going to offer Storyline 360: JavaScript Best Practices and Examples as having some good information. Then I looked closer at their "Change the value of a Storyline variable" example, and lo and behold the first 5 JavaScript statements are not terminated with semicolons! Seriously, Articulate? This conversation has been around longer than you have.
Semicolon Insertion: July 2000 Draft, JavaScript 2.0, Rationale
Do you recommend using semicolons after every statement in JavaScript?
I don't trust a parser to automatically insert a semicolon where it thinks it might need to go. That's why programming languages like C, C++, and Java specify using a semicolon to let the compiler know it has reached the end of a command.
If you want to test your JavaScript, copy and paste it in JSLint. Unsurprisingly, it did not like what came from Articulate, but it did quite a bit better with Russell's version (JSLInt obviously wouldn't understand player.GetVar / player.SetVar).