A Proxy in JavaScript is an object that wraps another object (called the target) and intercepts operations performed on the target, such as property access, assignment, function invocation, and more. Proxies allow you to define custom behavior for fundamental operations on objects.
What are WeakMaps and WeakSets in JavaScript?
Answer:
WeakMap: A collection of key-value pairs where the keys must be objects and the values can be arbitrary values. The keys in WeakMap are held weakly, meaning they do not prevent garbage collection.
WeakSet: A collection of objects, held weakly. Objects in a WeakSet can be garbage-collected if there are no other references to them.
Source link
lol