title: Conditional variable existence, returning error when nonexistent
body: <p>I have a function that has the parameter <code>_parameter</code>.  Ideally, I would like it to be able to contain one or many different JSON-formatted values, without requiring them all to be present.  I have constructed a series of conditions to check this, and below is one snippet from the set, as this (and its archetype) is throwing the error below.  <strong>How do I check to see if <code>_parameters["location"]["area"]</code> exists without throwing an error and without using the <code>try...catch</code> as that would result in tremendous redundancy?</strong></p>
  
  <p>What I would like to use is the following code, or some variation as long as it is still a ternary statement:</p>
  
  <pre><code>this.area = typeof _parameters["location"]["area"] !== 'undefined' ? _parameters["location"]["area"] : this.location["area"];
  </code></pre>
  
  <p>For giggles, I tried these, as well:</p>
  
  <pre><code>this.area = _parameters["location"]["area"] !== undefined ? _parameters["location"]["area"] : this.location["area"];
  
  if(_parameters["location"]["area"]) {
      alert(true);
  } else {
      alert(false);
  }
  </code></pre>
  
  <p>However, these both return the following error and no alert() menu is ever seen:</p>
  
  <pre><code>"Uncaught TypeError: Cannot read property 'area' of undefined"
  </code></pre>
  
  <p>This throws the same error, but resolves gracefully:</p>
  
  <pre><code>try {
     _parameters["location"]["area"]; 
  } catch (e) {
      alert(e);
  }
  </code></pre>
  
  <p><strong>EDIT</strong>
  For clarity, here are some options that <code>_parameter</code> could contain, and an idea of the structure that I'm trying to produce:</p>
  
  <pre><code>this.name = _parameters["name"] !== undefined ? _parameters["name"] : this.name;
  this.gender = _parameters["gender"] !== undefined ? _parameters["gender"] : this.gender;
  this.location = {
      area : typeof _parameters["location"]["area"] !== 'undefined' ? _parameters["location"]["area"] : this.location["area"],
      x : _parameters["location"]["x"] !== undefined ? _parameters["location"]["x"] : this.location["x"],
      y : _parameters["location"]["y"] !== undefined ? _parameters["location"]["y"] : this.location["y"]
  };
  </code></pre>