Unit 10: Modern JavaScript - Async, Fetch & Forms

10.1 Form Validation & Storage

Form Validation:

Form Processing:

Web Storage:

10.2 Asynchronous JavaScript & Promises

Promises: Handle async operations

Async/Await (ES7): Modern way to handle promises

10.3 Fetch API

Fetch API: Make HTTP requests

Practice Problems (Practical 23-24 & Additional)

Practical 23: Create calculator with two number inputs, operation dropdown (+, -, *, /), and button.
On click: Perform calculation using Promise.
- Resolve with result if valid
- Reject if invalid or division by zero
- Use .then() for result, .catch() for errors, .finally() to show "Calculation Finished"
Practical 24: Create login form with username and password validation:
1. Password: 6-12 characters
2. Username: Cannot start with _, @, or number
3. Both fields required
Additional Practical: Create contact form with fields for username, email, message.
On submit: Save data to localStorage
Retrieve and display stored data below form
Q1: What are Promises? Explain states: pending, fulfilled, rejected.
Q2: Difference between .then().catch() and async/await.
Q3: What is Fetch API? How do you make GET and POST requests?
Q4: Explain localStorage vs sessionStorage vs cookies.
Q5: How do you validate a form before submission?
Q6: Write a regex pattern to validate email addresses.
Q7: How do you handle errors in Promises and async/await?
Q8: Create a function to fetch data from JSONPlaceholder API and display it.
✨ Created by DRThummar ✨

💻 Comprehensive FSD Practical Exam Preparation Material

📅 Updated: 2026 | 📚 Course Code: 117013392

🔗 GitHub Repository