cara menampilkan halaman html hanya sekali

if (localStorage.getItem("visited")) {
    window.location.href = "webPlatform.html";
}
localStorage.setItem("visited", "true");
Zeevx