I have an array with the following data
var a = [1,2,3,4,5,6,7]
I am looking for a method in underscore.js or backbone.js in which I can return the elements with a specified range. for ex:
filter(2,5) should return [3,4,5,6]
which is the 2nd to 5th index elements in the array. Any pointers for me ?
Javascript Array should be defined like below,
And then you can use array native slice method to get elements from a specific position
Edit:
Underscore js do not have function like
sliceas it is already available in native js.