Overview
Backport allows you to quickly add missing constants to the JS API.If the constant already exists, it will not be altered.
Availability
Backport.js v0.1 and above.
Syntax
// add constant if missing var returnValue = backport(name,value); // value must be a string, number or boolean
Parameters
Parameter | Type | Mandatory | Description | Backport version |
---|---|---|---|---|
name | String | The name of the constant as a string (in quotes). | 0.1 | |
value | Number String Boolean | The value of the constant. It must be a number, string or boolean value. | 0.1 |
Return value
Value | Type | Description | Backport verison |
---|---|---|---|
<status> | Variant | The new status of the constant (see status return values). | 0.1 |
Examples
See the source code of these backport scripts for great examples:
- dorder.js – adds a load of missing DORDER constants
- daction.js – adds a load of missing DACTION constants
See also
- to follow