Here is the code snippet I am using:
for(var i=0; i < localStorage.length; i++) {
var subjects = [];
var key, value;
key = localStorage.key(i);
value = localStorage.getItem(key);
var keysplit = key.split(".");
if(keysplit[keysplit.length] == "subj") {
subjects.push(value);
}
}
I am encountering an issue where my code is not correctly selecting all the keys that end with .subj. Any suggestions on how to fix this problem?