VirtualMV/JavaScript/Starting/Operators

Conditional Operators
JavaScript also contains a conditional operator that assigns a value to a variable based on some condition. JavaScript Comparison and Logical Operators (W3Schools)

Examples

 * 1) First example, if the visitor = PRES then put Dear President otherwise just Dear
 * 2) Here id d is < 10 then a zero is added to the front else just leave d as is.

Example (js1_05)
Example :.

Note that in the example the variables are assigned numbers. If you accept values from a prompt or a text box (from a form) the "numbers" are actually text so need to be converted if you want to do arithmetic operations on them.