* Remove an item from an array * //删除数组
(arr, item)
| 172 | * //删除数组 |
| 173 | */ |
| 174 | function remove(arr, item) { |
| 175 | if (arr.length) { |
| 176 | var index = arr.indexOf(item); |
| 177 | if (index > -1) { |
| 178 | return arr.splice(index, 1) |
| 179 | } |
| 180 | } |
| 181 | } |
| 182 | |
| 183 | /** |
| 184 | * Check whether the object has the property. |
no test coverage detected