zach makes sense, however, in order to handle not only the fourth, but also the scroll back index, you must do this before passing the index and consider it successful:
index = index <= 0 ? index + 1 : index -1;
IE, the code shown should look like this:
get: function(index, count, success) { var result = [ {"guid":"8544a1c7-d637-42ae-836a-8a71901b44ca"},{"guid":"aff1450c-b4dd-4aa0-9b12-ea097e72c6fa"}, {"guid":"a1c68796-7a28-4721-904a-4944234e253e"},{"guid":"8b7d881f-20ea-4b6c-a8d6-772e1236e6bf"}, {"guid":"398c50a7-885e-4455-b741-66ebc2a64060"},{"guid":"81557a60-60b5-425a-9839-cf1da7e21bde"}, {"guid":"ed48be4e-5963-47a1-b872-2bf20bec5da3"},{"guid":"15d9fa95-f824-4bd9-8b75-afb8dec99f03"}, {"guid":"eaf2e5aa-24a4-4995-82d5-e661efc64556"} ]; index = index <= 0 ? index + 1 : index -1; success(result.slice(index, index + count)); }
source share