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

Function GetAll

src/utils/array/GetAll.js:31–54  ·  view source on GitHub ↗
(array, property, value, startIndex, endIndex)

Source from the content-addressed store, hash-verified

29 * @return {array} All matching elements from the array.
30 */
31var GetAll = function (array, property, value, startIndex, endIndex)
32{
33 if (startIndex === undefined) { startIndex = 0; }
34 if (endIndex === undefined) { endIndex = array.length; }
35
36 var output = [];
37
38 if (SafeRange(array, startIndex, endIndex))
39 {
40 for (var i = startIndex; i < endIndex; i++)
41 {
42 var child = array[i];
43
44 if (!property ||
45 (property && value === undefined && child.hasOwnProperty(property)) ||
46 (property && value !== undefined && child[property] === value))
47 {
48 output.push(child);
49 }
50 }
51 }
52
53 return output;
54};
55
56module.exports = GetAll;

Callers 3

Group.jsFile · 0.85
GetAll.test.jsFile · 0.85

Calls 1

SafeRangeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…