MCPcopy Index your code
hub / github.com/phaserjs/phaser / RemoveBetween

Function RemoveBetween

src/utils/array/RemoveBetween.js:27–55  ·  view source on GitHub ↗
(array, startIndex, endIndex, callback, context)

Source from the content-addressed store, hash-verified

25 * @return {Array.<*>} An array of items that were removed.
26 */
27var RemoveBetween = function (array, startIndex, endIndex, callback, context)
28{
29 if (startIndex === undefined) { startIndex = 0; }
30 if (endIndex === undefined) { endIndex = array.length; }
31 if (context === undefined) { context = array; }
32
33 if (SafeRange(array, startIndex, endIndex))
34 {
35 var size = endIndex - startIndex;
36
37 var removed = array.splice(startIndex, size);
38
39 if (callback)
40 {
41 for (var i = 0; i < removed.length; i++)
42 {
43 var entry = removed[i];
44
45 callback.call(context, entry);
46 }
47 }
48
49 return removed;
50 }
51 else
52 {
53 return [];
54 }
55};
56
57module.exports = RemoveBetween;

Callers 1

Calls 1

SafeRangeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…