getRangeArray method
Return an array given an index interval
start
: start index close intervalend
: end index open interval
Examples
var a = Array([1,2,3,4,5]);
var b = a.getRangeArray(1, 3);
print(b);
/* output:
Array([2, 3]);
*/
Implementation
Array getRangeArray(int start, int end, {int step = 1}) {
var b = Array.empty();
for (var i = start; i < end; i += step) {
b.add(this[i]);
}
return b;
}