if isset statement with javascript?
<p>În php I would use this to see if a variable is set and then use that value, otherwise make it a zero:</p>

<pre><code>    $pic_action = isset($_POST['pic_action']) ? $_POST['pic_action'] : 0;
</code></pre>

<p>But what is the equivalent in javascript?</p>

<p>I want to check if an element exists in the document, and then if it does, add it to the variable, otherwise add some other value to it, here is what I have so far:</p>

<pre><code>    var areaOption = document.getElementById("element");
</code></pre>

<p>Thanks</p>
