loop through an object, jump out of it when the item is matched -Javascript <p>I want to loop through a dynamic object, match the value, if item matched, jump out of the loop...</p> <p>Let say have an object:<code>{a:false:b:true,c:false}</code> I want to do something like (with <a href="https://lodash.com/docs/4.16.4#forOwn" rel="nofollow">loadash</a>),</p> <pre><code>_.fowOwn({a:1,b:2}, function (value, key) { console.log(key); if(value); break; }); </code></pre> <p>So this should log <code>(a &amp; b)</code>. How can I <code>break</code> when the item is matched ?</p> <p>Thanks for any help.</p>