Declaring Local Variables

Use the term var to declare a new local variable.

var variable

A local variable is available only to the function or event handler script that defines it, and cannot be accessed by another function or event. Once a name is declared, it is assigned a value of null or undefined unless you assign a specific value when declaring the variable name.

In the Intelligence Client object model, it is helpful to adopt a naming convention that starts with the type of object and includes the action or value. For example, a list box containing StoreType data values could be named Lbx_storeType.

Caution!

JavaScript is case-sensitive. A variable named Lbx_StoreType is not the same as lbx_StoreType.