Summary
In this chapter, we looked at two important concepts. ES6 proxies are useful meta programming constructs used to define custom behavior for fundamental operations (for example, property lookup, assignment, enumeration, function invocation, and so on). We looked at how to use handlers, traps, and proxy targets to intercept and modify the default behavior of operations. This gives us very powerful meta programming capabilities earlier lacking in JavaScript.
The other important construct we discussed in this chapter was ES6 promises. Promises are important because they make asynchronous programming constructs easier to work with. A promise acts as a proxy for a value not necessarily known when the promise is created. This lets asynchronous methods return values like synchronous methods - instead of the final value, the asynchronous method returns a promise for the value at some point in the future.
These are two very powerful constructs in ES6 that greatly enhance the language's...