JavaScript Proxies and Reflection
Get to grips with one of JavaScript's least used, but most powerful modern features; the Proxy and Reflect APIs, and learn what these APIs are for, how to use them, and when to use them.
What you'll learn
Proxy and Reflect APIs are tragically underutilized. In this course, JavaScript Proxies and Reflection, you will learn foundational knowledge of JavaScript's meta-programming capabilities. First, you will learn exactly what these two APIs are and the kinds of problems they were intended to solve. Next, you will learn all of the proxy traps which can be used (and what a proxy trap actually is), which practical examples of all 13 traps in action. Finally, you will finish up by looking at the Reflect API in detail, to see why this API is useful, and when it should be used. Additionally, you'll go back over some of the previous examples and update them to use Reflection where appropriate. When you’re finished with this course, you will have the skills and knowledge of Proxies and Reflect to put them to good use in your own personal and professional JavaScript projects.
Table of contents
- Overview 2m
- Using the Get Trap for Property Access 4m
- Using the Set Trap for Property Assignment 4m
- Hooking into Iteration with the OwnKeys Trap 3m
- Using the DeleteProperty Trap to Manage the Delete Operator 2m
- Using the Has Trap to Manage the In Operator 2m
- Demo - Creating Objects That Make HTTP Requests Automatically 4m
- Summary 2m
- Overview 2m
- Wrapping Functions with the Apply Trap 5m
- Handling Object Creation with the Construct Trap 4m
- Working with Prototypes: Using GetPrototypeOf and SetPrototypeOf 5m
- Working with Properties 1: IsExtensible, and PreventExtensions Traps 5m
- Working with Properties 2: The DefineProperty, and GetOwnPropertyDescriptor Traps 5m
- Summary 1m