Activity 9

1. What quantifier matches 0 or more repetitions?

2. What method converts JavaScript objects to JSON?

3. What does the try...catch statement do?

4. What is a common debugging tool?

5. What does regex stand for?

6. Which keyword is used to manually throw an error?

7. How do you validate email addresses in JavaScript?

8. How do you set breakpoints in Chrome?

9. Which method retrieves a key-value pair from local storage?

10. What is the output of JSON.stringify()?

Correct Answers

1. What quantifier matches 0 or more repetitions? ✅ *

2. What method converts JavaScript objects to JSON? ✅ JSON.stringify()

3. What does the try...catch statement do? ✅ Handles errors in code

4. What is a common debugging tool? ✅ console.log()

5. What does regex stand for? ✅ Regular expressions

6. Which keyword is used to manually throw an error? ✅ throw

7. How do you validate email addresses in JavaScript? ✅ Use regex

8. How do you set breakpoints in Chrome? ✅ Open Inspect and navigate to Sources tab

9. Which method retrieves a key-value pair from local storage? ✅ window.localStorage.getItem()

10. What is the output of JSON.stringify()? ✅ A JSON string

Instructions:

Set Up Your Development Environment

Email Validation using Regular Expressions

Local Storage Example

Final Output

Email Validation and Local Storage Example

Type an email address in the input box and click "Validate" to check if it's valid.

Enter your name in the second input box and click "Save Name" to store it in local storage.