for(var i=0, len=localStorage.length; i<len; i++) {
var key = localStorage.key(i);
var value = JSON.parse(localStorage.getItem(key));
console.log(key + " => " + value);
let users = value.username;
let scores = value.score;
let names = value.name;
Image of the local storage:
The Code Above is how i access the local storage values e.g. value.score (Variable scores) will give the users score. on another webpage i have a leader board table and I want to rank the scores e.g. the user Meanace to be rank 1 and James to be rank 2 as he has a lower score. i Would also like to do that for all new users as well, and store the top 3 scores for other uses on the page thanks How would i Do that?