I need to fetch some chunks of data in a Javascript loop. The pieces will probably be small between 2 and 20 Kb but being in a loop I need speed. I can get these pieces of code from local storage:
var code = localStorage.getItem(myVar);
or even from jQuery .data()
var code = $('#myDiv').data(myVar);
I was unable to find info on localStorage or sesionStorage speed or if I can cache these values into memory.
What would be fastest and better to use? Thanx