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 core capabilities.

In the next chapter, we will look at the fascinating possibilities around browsers and DOM manipulation using JavaScript.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.141.100.120