var hasla = new Array(2);
for (var i = 0; i < hasla.length; i++) {
hasla[i] = new Array(5);
}
hasla[0][0] = "a";
hasla[0][1] = "aa";
hasla[0][2] = "aaa";
hasla[0][3] = "aaaa";
hasla[0][4] = "aaaaa";
hasla[1][0] = "b";
hasla[1][1] = "bb";
hasla[1][2] = "bbb";
hasla[1][3] = "bbbb";
hasla[1][4] = "bbbbb";
let z = Math.floor(Math.random() * 2)
let y = Math.floor(Math.random() * 5)
var haslo = hasla[z][y]
haslo = haslo.toUpperCase();
console.log(haslo)
function rewrite()
{
var valuetorewtrie = hasla[1][1]
localStorage.setItem("storedValue", valuetorewtrie);
var haslo = localStorage.getItem("storedValue");
var newContent1 = `
(jakiś html)
`;
document.getElementById("test").innerHTML = newContent1;
}
console.log(haslo);
// reszta kodu gdzie będę potrzebować "hasło" po nadpisaniu
jak napisać kod aby uzyskać dostęp do napisanej wartości żeby nowa wartość "hasło" była dostępna w całym kodzie nie tylko w funkcji?