Skip to main content

mapRange()

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

mapRange(from: number, to: number, callback: function): object[];

Parameters:

  • from: number - the initial position of an item in the range
  • to: number - the final position of an item in the range
  • callback: function - a function that will be called for each item from the specified range

Returns:

A new array of matching item objects.

Example

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