Design Patterns · Junior · Question 12 of 75
What is the Proxy pattern used for?
- ✓Correct answer: To control access to an object: caching, checks, laziness
- 2To combine several objects into one tree with a common root
- 3To create complex objects step by step through a chain of calls
Explanation
A proxy has the same interface as the original and intercepts access: lazy initialization, caching, validation, logging. JS has a built-in Proxy - Vue 3's reactivity is built on it.