Add practice attempts, filter by minimum score, and watch a live clock. Empty names throw an Error. Passing rows use a ternary badge.

Clock:

Filtered attempts

Add an attempt to begin.

Important JavaScript

const { name, score } = attempt;
const badge = score >= 60 ? "Pass" : "Retry";

const visible = attempts.filter(function (row) {
  return row.score >= minScore;
});

clockId = setInterval(function () {
  clock.textContent = new Date().toLocaleTimeString();
}, 1000);

if (!name) {
  throw new Error("Name is required.");
}