What is the purpose of the Proxy object in JavaScript?

What is the purpose of the Proxy object in JavaScript?

a) To intercept and redefine fundamental operations on objects
b) To clone an object
c) To create a deep copy of an object
d) To delete properties from an object

Answer:

a) To intercept and redefine fundamental operations on objects

Explanation:

The Proxy object allows you to create a proxy for another object, which can intercept and redefine operations such as property access, assignment, and method invocation. Proxies provide a way to customize the behavior of fundamental JavaScript operations.

Reference:

JavaScript MCQ (Multiple-Choice Questions)

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top