Memory Ai Learning Preferences
OpenMates uses saved AI learning preferences in a real chat.
memory · ai · learning preferences
Last updated:
Use my saved AI learning preferences memory to design a 30-minute practice plan for understanding JavaScript promises. You may request and use that saved memory. Keep the answer plain text only: no fenced code blocks, no JSON, no markdown tables, no app skills, no embeds, no web search, no documents, and no follow-up question. Include one tiny inline example and two exercises.
Based on your saved preference for hands-on, example-first learning, here is your 30-minute practice plan for JavaScript Promises. PRACTICE PLAN: UNDERSTANDING PROMISES (30 MINUTES) 00:00 - 05:00 PHASE 1: THE TINY START A Promise is an object representing the eventual completion of an asynchronous operation. Tiny Example: const p = new Promise(res => res('Ready')); p.then(v => console.log(v)); 05:00 - 15:00 PHASE 2: EXERCISE 1 - TIME DELAYS Task: Create a Promise that resolves with the string 'Success' after exactly 2 seconds. Use setTimeout inside the Promise to handle the delay, then log the result using .then(). Objective: Understand how Promises wait for tasks to finish. 15:00 - 20:00 PHASE 3: THE PROMISE CHECKLIST - Initialize using: new Promise((resolve, reject) => { ... }) - Success path: call resolve(data) to trigger .then() - Error path: call reject(error) to trigger .catch() - Handling: .then() receives the resolved value; .catch() receives the rejection reason. 20:00 - 30:00 PHASE 4: EXERCISE 2 - LOGIC AND REJECTION Task: Write a function called validate(num) that returns a Promise. If num is even, resolve with 'Even number'. If num is odd, reject with 'Odd number'. Call the function with an odd number and ensure you use .catch() to log the error message. Objective: Practice handling different Promise states and error flows.