get value from JavaScript object, if first 8 digits of property matched with argument? : <p>Here i need get a value from JavaScript object, if the first 8 digits of property is matched with argument.</p>

<p>Here is what I'm tried...</p>

<pre><code>var input = { 4546546512349: {}, 7200000000007: {}, 9399543200000: {} }
function find_key(query){
  $.each(input, function(k, v) {
    if (k.substring(0,8) == query){
      console.log(k);
      return k        
    }  
  });
}
find_key(45465465);
</code></pre>

<p>Is there any best solution for this. Thanks in advance.</p>
