Main Topics
- No spaces in the name
- No digits in front
- Underscore are ok, but they are not encouraged
- Dollar signs are ok, but they are not encouraged
- Begin with lowercase and then camel case
Sample
var myVariable = 3
var myVariable2 = "The content of the variable"
Once the variable has been defined with the "var" modifier, there is no need to use the modifier again to alter the content of the variable
myVariable2 = "Some other content"
Sample
var myNumericalVariable1 = 1
var myNumericalVariable2 = 1
myNumericalVariable++ // This outputs "2"
myNumericalVariable-- // This outputs "0"
Suppose we have already declared the variable : myVariable
Operations
myVariable += 2 // makes a pre-adding operation with the current value of myVariable and 2, and then assign the result to myVariable
myVariable -= 3 // makes a pre-subtract operatin with the current value of myVariable and 3, and then assign the result to myVariable
myVariable *= 2 // makes a pre-multiply operation with the current value of myVariable and 2, and then assign the result to myVariable
myVariable /= 3 // makes a pre-dive operatin with the current value of myVariable and 3, and then assign the result to myVariable