MCPcopy
hub / github.com/phaserjs/phaser / RemoveAt

Function RemoveAt

src/utils/array/RemoveAt.js:26–43  ·  view source on GitHub ↗
(array, index, callback, context)

Source from the content-addressed store, hash-verified

24 * @return {*} The item that was removed.
25 */
26var 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
45module.exports = RemoveAt;

Callers 2

RemoveAt.test.jsFile · 0.50
RemoveAt.test.jsFile · 0.50

Calls 1

SpliceOneFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…