|
|
@ -110,7 +110,15 @@ function isExtensible(obj) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function remove(arr, item) { |
|
|
|
function remove(arr, item) { |
|
|
|
if (arr && arr.length) { |
|
|
|
if (!arr) { |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
const len = arr.length; |
|
|
|
|
|
|
|
if (len) { |
|
|
|
|
|
|
|
if (item === arr[len - 1]) { |
|
|
|
|
|
|
|
arr.length = len - 1; |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
const index = arr.indexOf(item); |
|
|
|
const index = arr.indexOf(item); |
|
|
|
if (index > -1) { |
|
|
|
if (index > -1) { |
|
|
|
return arr.splice(index, 1); |
|
|
|
return arr.splice(index, 1); |
|
|
|