Introduction

In the previous chapter, we saw how to use the new class syntax to implement behavior that was only slightly more difficult to implement directly with a prototype. A developer could be excused for thinking that this complexity of the language was not worth it. After all, it's only a line (or perhaps a character) or two extra to get the same behavior.

The real advantage of using the new ES6 class syntax to create object prototypes is revealed when more complicated structures and techniques are used. In essence, we'll see that it's much easier to understand code when the behavior is defined with keywords, rather than context-sensitive operators.

In this chapter, we'll look at how to implement some more sophisticated behaviors using classes.

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

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