(arr: any[], index: number)
| 53 | } |
| 54 | |
| 55 | export function removeFromArray(arr: any[], index: number): any { |
| 56 | // perf: array.pop is faster than array.splice! |
| 57 | if (index >= arr.length - 1) { |
| 58 | return arr.pop(); |
| 59 | } else { |
| 60 | return arr.splice(index, 1)[0]; |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | export function newArray<T = any>(size: number): T[]; |
| 65 | export function newArray<T>(size: number, value: T): T[]; |
no test coverage detected
searching dependent graphs…