function to set value in local storage code example
Example 1: set localstorage
function set(){
var sendJson = JSON.stringify(arrayName);
localStorage.setItem('key',sendJson)
}
Example 2: setlocalstorage
localStorage.setItem('data', JSON.stringify(arryName));