for (var i in yourObjects) { ... } and .hasOwnProperty() ... discussion
<pre><code>var yourObjects = [ 

{ object: {obj1:"aa"}, direction: 'top' },
{ object: "obj2", direction: 'left' }, 
{ object: "obj3", direction: 'bottom' }

]; 

for (var i in yourObjects) { alert(i); }
</code></pre>

<p>There was a long discussion about that. 
Using <code>for in</code> to iterate an Object returns all properties and methods of the Object, so normally <a href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/hasOwnProperty" rel="nofollow">.hasOwnProperty()</a> method should be used. But when we iterate an array, in fact <code>for in</code> iterates the indexes of the array (or keys if it is an associative array). I tried it in all browsers I have. But when tried in jsfiddle  ... it wasn't the same ... returned all methods which an array have. </p>

<p>So my questin is: Is it safe to use <code>for in</code> to iterate an array?   </p>

<p>Try this code in your browser and in jsfiddle, and tell me what do you think.</p>
