JavaScript · Senior · Question 8 of 75
What is Proxy used for?
- ✓Correct answer: To intercept operations on an object: reads, writes, deletions
- 2To route HTTP requests through an intermediate server
- 3To create immutable deep copies of objects
Explanation
Traps such as get, set, has and deleteProperty let you implement reactivity (that's how Vue 3 works), validation, logging and default values. Reflect provides the default behavior of operations for use inside traps.