Variables
Declaration
Variable is declared with a keyword var
, followed by variable name.
You can specify the initial value with the =
sign, as with JavaScript.
var notInitializedVar;
var initializedVar = "Hello";
Type of variable is inferred from type of initial value expression. When variable has no initial value then its value is inferred from its usages.
Usage
Variable can be used by referring it by its name.
notInitializedVar = "World!";
notInitializedVar = initializedVar + ", " + notInitializedVar;
Sample
var user;
if (issue.Assignee == null) {
user = issue.project.leader;
} else {
user = issue.Assignee;
}
Last modified: 18 April 2017