title: jQuery: why doesn't jQuery.inArray() work?
body: <p><img src="https://i.stack.imgur.com/gXMdZ.png" alt="enter image description here"></p>
  
  <p>As shown in the image, I just do inArray on an array, looking for a node. and $previously_selected_node and the item at index 37 in $shapes are the same object.... so... why isn't it working?</p>
  
  <p>EDIT:
  I found another way to search after one of the aswerers postedd his answer:</p>
  
  <pre><code>var result = -1;
  jQuery.each(shapes, function(key, value){
      if (value.id == shape.id){
          result = key;
      }
  });
  return result;
  </code></pre>
  
  <p>apparently, part of my problem is that I can't return in the middle of a loop. (I was returning the instant a match was found, which was causing some issues.)</p>