I have a single pair key and value stored in a localStorage. I want to put all records stored there into array:
function fillRecordArray(){
recordArr.splice(0,recordArr.length);
for(var i in localStorage)
{
var record = new Record(i,localStorage[i]);
recordArr.push(record);
}
}
Which works perfectly fine until I stopped to use Chrome and tested it on Mozilla. In this case I besides the data I saved I also get 6 extra array elements with these values:
1
function key() { [native code] }
function getItem() { [native code] }
function setItem() { [native code] }
function removeItem() { [native code] }
function clear() { [native code] }
What can cause this problem and is there any way to avoid it, besides just stripping it out from an array?
Thank you in advance.