(array, index, callback, context)
| 24 | * @return {*} The item that was removed. |
| 25 | */ |
| 26 | var RemoveAt = function (array, index, callback, context) |
| 27 | { |
| 28 | if (context === undefined) { context = array; } |
| 29 | |
| 30 | if (index < 0 || index > array.length - 1) |
| 31 | { |
| 32 | throw new Error('Index out of bounds'); |
| 33 | } |
| 34 | |
| 35 | var item = SpliceOne(array, index); |
| 36 | |
| 37 | if (callback) |
| 38 | { |
| 39 | callback.call(context, item); |
| 40 | } |
| 41 | |
| 42 | return item; |
| 43 | }; |
| 44 | |
| 45 | module.exports = RemoveAt; |
no test coverage detected
searching dependent graphs…