JSFiddle - React, Tailwind, and code Playground
by jfriend00
HTML
<script src="http://files.the-friend-family.com/log.js"></script>
Reload this page multiple times to see values added to the array each time.<br><br>
JavaScript
var currentData = JSON.parse(localStorage.getItem("currentData") || "[]");
log(currentData);
currentData.push(Math.floor(Math.random() * 100));
localStorage.setItem("currentData", JSON.stringify(currentData));