mapRange

returns a new array of the items correspond to the specified parameters

array mapRange(number from,number to,function handler);

Parameters

fromnumberthe initial position of an item in the range
tonumberthe final position of an item in the range
handlerfunctiona function that will be called for each item from the specified range

Returns

arraya new array of matching item objects

Example

var result = diagram.data.mapRange(0, 20, function(item, index) {
    console.log(item.id, index);
});

Back to top