JS - Check if all an object's own properties are true
<p>I have an object that has several fields that could potentially get shifted to true for a user (think like a list of achievements). If I had an object like <code>{one: true, two: false, three: true}</code>, how would I be able to escape the execution of the function (because not all the keys are true)? This is what I have tried so far: </p>

<pre><code>for (var key in achis) {
    if (achis.hasOwnProperty(key)) {
        if (key === false) {
            cb &amp;&amp; cb();
            return;
        } 
    }
}
achievements.update({userId: achis.userid}, {$set: {all: true}}, function(err) {
    if (err) {
        console.log(err);
    }
    cb &amp;&amp; cb();
    return;
});
</code></pre>

<p>How would I be able to only update the acheivements doc field "all" to true if all the key values in achis is "true" like this: <code>{one: true, two: true, three: true}</code></p>