js判断数组中有没有指定元素

list.findIndex(target => target.sel === 指定元素) ,如果找到返回下标,如果没有返回-1
posted @ 2019-04-16 09:31  ThisCall  阅读(784)  评论(0编辑  收藏  举报