Week 2
Last updated
// Example: Simulated database lookup
function findTeaById(id, callback) {
setTimeout(() => {
const tea = teas.find((t) => t.id === id);
callback(tea);
}, 500);
}
findTeaById(3, (tea) => {
console.log("Found:", tea.name);
});