JavaScript根据Id取出数组中指定的对象

var obj=arr.find(function (obj) { return obj.id === 2 }) arr为包含对象的数组,取出的obj是数组arr中一个id为2的对象html
相关文章
相关标签/搜索