分享下js删除数组中的指定元素的方法。
Array.prototype.remove = function(val) { var index = this.indexOf(val); if (index > -1) { this.splice(index, 1); } }
调用方式为:
var element = "xx" arr.remove(element)
分享下js删除数组中的指定元素的方法。
Array.prototype.remove = function(val) { var index = this.indexOf(val); if (index > -1) { this.splice(index, 1); } }
调用方式为:
var element = "xx" arr.remove(element)
Vue前端开发:实现圆环进度条03-25
vueJs中的跨域解决方案10-22
用JS实现用户禁止WEB复制08-14
你想知道谷歌是怎么样面试程序员的吗07-29
使用JavaScript替换数组中的项01-11
网友评论文明上网理性发言 已有0人参与
发表评论: