Не проверял, но должно сработать:
function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min) + min);
}
const blockList = Array.from(document.querySelectorAll('.fact_block'));
const limitationBlock = document.querySelector('.limitation');
const INTERVAL = 1000 * 60 * 60 * 10; // 10 часов
const STORAGE_KEY = 'random-block';
const currentStorageValue = Number(window.localStorage.getItem(STORAGE_KEY));
if (Number.isNaN(currentStorageValue) || currentStorageValue < Date.now() - INTERVAL) {
const randomBlockItem = blockList[getRandomInt(0, getRandomInt.length - 1)];
window.localStorage.setItem(STORAGE_KEY, String(Date.now()));
randomBlockItem.classList.add('show');
} else {
limitationBlock.classList.add('show');
}