(arr: T[], obj: T)
| 17 | * me.utils.array.remove(arr, "foo"); |
| 18 | */ |
| 19 | export function remove<T>(arr: T[], obj: T): T[] { |
| 20 | const i = Array.prototype.indexOf.call(arr, obj); |
| 21 | if (i !== -1) { |
| 22 | Array.prototype.splice.call(arr, i, 1); |
| 23 | } |
| 24 | return arr; |
| 25 | } |
| 26 | |
| 27 | /** |
| 28 | * return a random array element |
no outgoing calls
no test coverage detected