Сорян, торопился и опечатался. Работает:
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 (blockList.length > 0 && ((Number.isNaN(currentStorageValue) || currentStorageValue < Date.now() - INTERVAL))) {
const randomBlockItem = blockList[getRandomInt(0, blockList.length - 1)];
window.localStorage.setItem(STORAGE_KEY, String(Date.now()));
randomBlockItem.classList.add('show');
} else {
limitationBlock.classList.add('show');
}
<div>
<div class="fact_block">1</div>
<div class="fact_block">2</div>
<div class="fact_block">3</div>
<div class="fact_block">4</div>
<div class="fact_block">5</div>
</div>
<div class="limitation">limitation</div>
.fact_block, .limitation {
display: none;
}
.fact_block.show, .limitation.show {
display: block;
}