Language Desk
Compose timers, filter, destructuring, ternary, Date, and Error in one desk.
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
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.");
}