title: Should I check on NaN parameters of a coordinate object?
body: <p>Using an <code>{ x: 0, y: 0 }</code> object(and objects that have <code>x</code> and <code>y</code> properties) for geometrical calculations. Thinking on a checking function.
  The question: do I need to check if <code>x</code> and <code>y</code> are numbers?
  E.g. which variant is better:</p>
  
  <pre><code>function isCoordObj ( obj ) {
      if ( obj.hasOwnProperty( 'x' ) 
        &amp;&amp; obj.hasOwnProperty( 'y' ) 
        &amp;&amp; !isNaN( obj.x ) 
        &amp;&amp; !isNaN( obj.y ) ) {
            return true;
      }
      throw new Error( 'not a Coord Object' );
  }
  </code></pre>
  
  <p>or this one is enough:</p>
  
  <pre><code>function isCoordObj ( obj ) {
      if ( obj.hasOwnProperty( 'x' ) 
        &amp;&amp; obj.hasOwnProperty( 'y' ) ) {
            return true;
      }
      throw new Error( 'not a Coord Object' );
  }
  </code></pre>