using short-circuit operators to throw error - javascript
<p>I know that jslint/jshint don't like it but I wanted to know if there were any real issues with doing something like.</p>

<pre><code>var err = function(msg) { throw new Error(msg); };
</code></pre>

<p><strong>Example 1:</strong> Assignment</p>

<pre><code>var foo = bar.foo || baz.foo || err('missing foo property');
</code></pre>

<p><strong>Example 2:</strong> Validation</p>

<pre><code>typeof foo['bar'] !== 'string' &amp;&amp; err('bar has to be a string');
</code></pre>

<p>Are there any gotcha's that I should be aware of?</p>
