How to know if all javascript object values are true?

How about something like:

    function allTrue(obj)
      for(var o in obj)
          if(!obj[o]) return false;
      return true;
    var myObj1 = {title:true, name:true, email:false};
    var myObj2 = {title:true, name:true, email:true};

    document.write('<br />myObj1 all true: ' + allTrue(myObj1));
    document.write('<br />myObj2 all true: ' + allTrue(myObj2));


A few disclaimers: This will return true if all values are true-ish, not necessarily exactly equal to the Boolean value of True. Also, it will scan all properties of the passed in object, including its prototype. This may or may not be what you need, however it should work fine on a simple object literal like the one you provided.