valid object property in javascript
<p>how can i check if any javaScript object's property exists and if it exists then it has a valid value?
actually,i am a beginner and trying to solve this-</p>

<blockquote>
  <p>Check if the second argument is truthy on all objects of the first argument(which is an array of objects).i.e.</p>
</blockquote>

<ul>
<li>check if the second argument exists in all the objects in first argument(an array) as a property.<br>
if it exists, it should not be-</li>
<li>invalid, as age can't be 0</li>
<li>null</li>
<li>undefined</li>
<li>empty string('')</li>
<li>NaN</li>
</ul>

<p>till now i have this-</p>

<pre><code>function truthCheck(collection, pre) {

  for(var i=0;i&lt;collection.length;i++){
    if(!(pre in collection[i])||collection[i]     

      [pre]===undefined||isNaN(collection[i]      

      [pre])||collection[i][pre]===""||           

      collection[i][pre]===null||collection[i]    

      [pre]===0)
       {
          return false;
       } 
   }
 return true;
}
</code></pre>

<p>i know this is not the best wayto solve .Is there a better way to do this?i don't like that long if statement in my code.i have seen other  SO links-<a href="https://stackoverflow.com/questions/11040472/check-if-object-property-exists-using-a-variable">link1</a>,<a href="https://stackoverflow.com/questions/135448/how-do-i-check-if-an-object-has-a-property-in-javascript">link2</a> but none of them seemed to solve my query. any kind of help is highly appreciated.
P.S. this code is not working for some true cases even.</p>