I am trying to store array in localstorage with following code :
var tempval = [];
tempval['key'] = 1;                    
localStorage.setItem("Message", JSON.stringify(tempval));
but in localstorage it showing only []
So how to store it and where I am doing mistake ?
 
     
     
     
     
    