UNPKG

nemoin

Version:
12 lines (10 loc) 228 B
const dates = []; for (let i = 0; i < 10; i++) { dates.push(new Date(Math.random() * Date.now() * 2)); } let i = 0; function nextRandomDate() { i = (i + 1) % dates.length; return dates[i]; } module.exports = nextRandomDate;