常用JS方法封装

常用JS方法封装

1
2
3
4
5
6
// 去掉数组中某个值
function remove(arr, item) {
if (arr.length && arr.indexOf(item) > -1) {
return arr.splice(index, 1)
}
}