We'll recap everything we've covered so far, and review the day's agenda.
classdoesn’t allow us to do anything that wasn’t possible with the direct use of prototypes, many things are easier and much cleaner. We’ll look at constructors, member and static functions, and the upcoming “member and instance field” TC39 proposals.
ClassesEXERCISE: Colors with classes
We’ll look back at our rgb/hex color exercises, and implement a more comprehensive solution using classes.
Decorators allow us to do things at class construction time. Several uses of decorators are possible with the current draft spec (or when using Typescript) and a variety of proposals for new decorators are already in development!
ClassesPROJECT: Memoized functions
Memoization is a technique that can be used with pure functions, where output values are “remembered” for an input argument(s). Thus, re-invoking the function with the same arguments will return the same “remembered” result. We’ll implement a
@memoizefunction decorator, so that we can apply this technique easily and cleanly in our code.
While it's true that
ClassesPROJECT: Design Patterns w/ Class
We’ll implement some examples of classical object-oriented design patterns using
Break for lunch