// JavaScript
var getIndexesOfArrayInLimits = function (array, minValue, maxValue){
var isInLimit = function (value) {
return value >= minValue && value <= maxValue;<br> }
var getIndexesOfArrayLimitedByFunc = function (array, func) {
var results = [];
array.forEach(function(element, index, array) {
if (!!func(element)) {
results.push(index);
}
});
return results;
}
return getIndexesOfArrayLimitedByFunc(array, isInLimit);
}
// That's an example of using the function
getIndexesOfArrayInLimits([1, 5, 2, 3, 4], 1, 3);