VirtualMV/JavaScript/Starting/Operators

Logical Operators
---

3 logicians walk into a cafe. The waiter asks "do you ALL want a drink?"

The first says "I don't know", the second says "I don't know" the third says "Yes please"

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
The following code shows that JavaScript allows for some quite sophisticated assignments.

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.