 <pre><code> var jamie = someVarThatCanBeUndefined || 'or maybe not'; </code></pre> <p>You can use the above to do coalescing</p> <p>Here is an answer with more details <a href="http://stackoverflow.com/questions/476436/null-coalescing-operator-for-javascript/476438#476438">Is there a &quot;null coalescing&quot; operator in JavaScript?</a></p> <p>If you wanted short hand notation for <code>if</code></p> <p>Try this instead:</p> <pre><code>boolCondition ? "OneStringForTrue" : "AnotherForFalse" </code></pre> <p>This is often called the </p> <pre><code>Conditional (Ternary) Operator (?:) (JavaScript) </code></pre>