Breaking out of a JavaScript for statement from within an if statement
<p>This is what I want to do: cycle through a complex data structure and if one of the elements meets some condition, return it.  But I don't think it's possible to return from within an 'if' that's within my for loop.  What's the best practice?  Thanks.</p>

<pre><code>function findIt(x) {
    for (i in someDataArray) {
        v = someDataArray[i];
        if (*v meets some condition*) {
            return v;
        }
    }
}
</code></pre>
