JSFiddle - React, Tailwind, and code Playground

JavaScript

function saveAllVariables(){
    //save all variables on the page to local storage
}

function loadAllVariables(){
    //load all variables on the page from local storage, and re-create them using their original names
}

loadAllVariables(); //load all variables that were previously stored

if(typeof theName == "undefined"){
    var theName = prompt("Please enter your name:","Your name");
}

if(typeof currentTime == "undefined"){
    var currentTime = new Date();
}

document.body.innerHTML += "Time last visited: " + currentTime + "<br />";
document.body.innerHTML += "Your name : " + theName + "<br />";
var currentTime = new Date();