Case-related rules:
JavaScript statements (for example, var, if…else, while, switch, and so on) begin with lowercase letters. The script Var StringName = "John Smith" fails because Var is capitalized.
JavaScript core operators start with uppercase letters, for example, new Date(). The script new date() fails because date is not capitalized.
Object model path segments begin with uppercase letters; for example, ActiveDocument.Sections["Dashboard"].Activate(). Both activeDocument.Sections["Dashboard"].Activate() and Activedocument.Sections["Dashboard"].Activate() fail because the ActiveDocument is not properly capitalized.
You must refer to variables as you define them. For example, if you define a variable as var StringName, you must refer to it as StringName, not Stringname or stringName or stringname.