Environment.declareVariableOrConst

Attempt to declare and assign a new variable in the current environment. Returns false if it already exists.

class Environment
bool
declareVariableOrConst
(
in string nam
,,
in bool isConst
)

Parameters

nam string

the name of the variable to set.

value ScriptAny

the initial value of the variable. This can be ScriptAny.UNDEFINED

isConst bool

whether or not the variable was declared as a const

Return Value

Type: bool

True if the declaration was successful, otherwise false.

Meta