JS數組不添加重複值 & 刪除指定值

JS數組的push沒法判斷重複值就不添加了,所以寫了個這個方法 直接在數組上使用即可  Array.prototype.push_unique = function () { for (var i = 0; i < arguments.length; i++) { var ele = arguments[i]; if (this.in
相關文章
相關標籤/搜索