My array of todos is like this:
[{id:1,text:"hello"},{id:2,text:"hey"},{id:3,text:"ho"},{id:4,text:"let's go"}]
I am just so confused I need help with this code like this, it's for pagination in react:
selectTodosToDisplay = (todos, { index1: 2, index2:3 }) => {
return [...todos.slice(index1, index2),
...todos.slice(index2) ]
}
so with the above code I want to result into this
[{id:3,text:"ho"},{id:4,text:"let's go"}]
Maybe there's other methods for this? Help?