A conditional operator is a programming construct whose value depends on some designated condition. In NWScript, there is one conditional operator, the ternary ?: operator, which is shorthand for certain types of "if-else" statements. The ?: operator has the format conditional ? value-if-true : value-if-false if ( conditional ) x = value-if-true; else x = value-if-false; While there may be no difference in the efficiency of the resulting script, the single-line version with ?: is often easier for a human to read, making the script easier to maintain.
| Graph IRI | Count |
|---|---|
| http://dbkwik.webdatacommons.org | 5 |