...
Code Block |
---|
var returnValue = backport("featureName"name); |
Parameters
Parameter | Type | Mandatory | Description | Backport version |
---|---|---|---|---|
featureNamename | String | The name (key) of the feature as a string (in quotes). | 0.1 |
...
Code Block |
---|
var status = backport("orderDroid"); // orderDroid() was added in Warzone 3.2 // basic type coercion examples if (status) { // the feature exists // status could be true, -1 or 1 } if (!status) { // the feature does not exist // status could be null or undefined } // remember that == (equality operator) also type coerces! if (status == true) { // status could be true, -1 or 1 } if (status != true) { // status could be null or undefined } if (status == null) { // status could be null or undefined } // use === (strict equality operator) if you need to check a specific value if (status === -1) { // the feature was added by a backport script // status must be exactly -1 } if (status === null) { // a deprecated feature was removed // status must be exactly null } if (status === true) { // the native, unaltered feature is present // status must be exactly true } |
See also
...
- Listing API features – get a list of names for all defined JS API features