Assignment
const API_BASE = "https://tea-api-787553294298.europe-west1.run.app/api";Exercise 1: Tea Search
async function searchTeas(query) {
// 1. Fetch all teas from the API
// 2. Filter to teas where name includes query (case-insensitive)
// 3. Return array of matching tea objects
}
// Test it:
searchTeas("pearl").then((teas) => {
console.log("Search results for 'pearl':");
teas.forEach((tea) => console.log(`- ${tea.name}`));
});Search results for 'pearl':
- Jasmine Pearl
- Royal Kenya Pearl
- Imperial China Pearl
- Mountain Sri Lanka PearlExercise 2: Tea Details
Exercise 3: Order Calculator ⭐
Exercise 4: Stock Check ⭐
Exercise 5: Full Order Flow ⭐⭐
Exercise 6: Authenticated Orders ⭐⭐
Submission
Last updated