How to exit from $.each function when condition met
<p>How can I exit from <code>$.each</code> loop when a condition is met? I don't want to iterate the collection further.</p>

<pre><code>$(vehicles).each(function() {
    if (this["@id"] === vehicleId[0]) {
      vehicle = this;
    }
});
</code></pre>

<p>I tried with <code>break;</code> &amp; <code>return;</code> statement but it looks the execution doesn't not stop at that point. Any idea would be greatly appreciated.</p>
