封装函数

/**
* Remove an item from an array
*/
function remove (arr, item) {
if (arr.length) {
var index = arr.indexOf(item);
if (index > -1) {
return arr.splice(index, 1)
}
}
}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-04
  • 2021-09-09
  • 2021-06-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-22
  • 2022-02-28
  • 2021-09-20
相关资源
相似解决方案