我有对象数组
var arr = [
{"id" : "1", "description" : "one"},
{"id" : "2", "description" : "two"},
{"id" : "3", "description" : "three"}]
我需要获取索引,例如,对于 id="2" 的对象。我做
var index = jQuery.inArray( {"id" : "2", "description" : "two"}, arr )
在索引中我得到-1。