first_page the funky knowledge base
personal notes from way, _way_ back and maybe today

JavaScript: Conditional Expressions

In Javascript, a variable value can be set based on a condition. This "shorthand" avoids writing an if/else structure:

<variable> = (<condition>) ? <value1> : <value2>

Where <variable> is set to <value1> if <condition> returns True or <value2> if <condition> returns false.

mod date: 1998-12-13T22:23:14.000Z