var SafeRange = require('./SafeRange'); var GetAll = function (array, property, value, startIndex, endIndex){ if (startIndex === undefined) { startIndex = 0; } if (endIndex === undefined) { endIndex = _AN_Read_length('length', array); } var output = [] ; if (SafeRange(array, startIndex, endIndex)) { for (var i = startIndex; i < endIndex; i++ ){ var child = array[i]; if (!property || (property && value === undefined && child.hasOwnProperty(property)) || (property && value !== undefined && child[property] === value)) { output.push(child); } } } return output; } ; module.exports = GetAll;