На фронте валидация нужна только для человеческого UX, что, конечно, важно, но не критически важно.
function startTimer(word, delay, callback) {
startTimer.prototype.previousTimer = null;
const timer = setInterval(
(word, callback) => {
console.log(word, timer);
if (startTimer.prototype.previousTimer !== timer) {
clearInterval(startTimer.prototype.previousTimer);
startTimer.prototype.previousTimer = timer;
}
callback();
},
delay,
word,
callback
);
}