I am trying to create a Cache Hashtable in Javascript.
by executing cache.splice(0,0, ...dataPage); I insert my data form the first till the dataPage.length
position.
Let's say my dataPage size is always 10
My cache array should look like
[0: {..}, 1: {..} ..... 9: {...}]
After that let's say I want to load the 5th page of data.
I'm executing cache.splice(40,0, ...data);
I'm expecting my array to look like
[[0: {..}, 1: {..} ..... 9: {...}, 40: {...}, 41:{...} ... 49{...}]
But it looks like
[[0: {..}, 1: {..} ..... 9: {...}, 10: {...}, 11:{...} ... 12{...}]
Any idea how I can achieve my expected result??