Reassignment of const Variables
JavaScript const variables create a read-only reference to a value. When a const variable is assigned a value, the variable identifier cannot be used again (reassigned). In SuiteScript 2.0, no error is thrown when you reassign a const variable. In SuiteScript 2.1, a TypeError is thrown.
|
Scenario |
SuiteScript 2.0 Behavior |
SuiteScript 2.1 Behavior |
|---|---|---|
|
Set a value for a
|
The script executes successfully, however the value of |
Script execution stops at the TypeError: Assignment to constant variable |