Javascript || or operator with a undefinded variable
<p>I have been doing some reading lately one article I read was from Opera.</p>

<p><a href="http://dev.opera.com/articles/view/javascript-best-practices/">http://dev.opera.com/articles/view/javascript-best-practices/</a></p>

<p>In that article they write this:</p>

<blockquote>
  <p>Another common situation in JavaScript
  is providing a preset value for a
  variable if it is not defined, like
  so:</p>
</blockquote>

<pre><code>if(v){
  var x = v;
} else {
  var x = 10;
}
</code></pre>

<blockquote>
  <p>The shortcut notation for this is the
  double pipe character:</p>
</blockquote>

<pre><code>var x = v || 10;
</code></pre>

<p>For some reason I cant get this to work for me. Is it really possible to check to see if v is defined, if not x = 10?</p>

<p>--Thanks.
Bryan</p>
