“Object doesn't support property or method 'find'” in IE

后端 未结 7 1467
时光取名叫无心
时光取名叫无心 2020-11-30 05:23




    

        

        
7条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-30 06:06

    Here is a work around. You can use filter instead of find; but filter returns an array of matching objects. find only returns the first match inside an array. So, why not use filter as following;

    data.filter(function (x) {
             return x.Id === e
        })[0];
    

提交回复
热议问题