filmov
tv
Exercises: Encapsulation and 'static' - Object Oriented Programming (OOP) - Javascript In Depth

Показать описание
Let's go through some exercises to get more practice with the concept of Encapsulation as well as the "static" keyword in Javascript together.
We start with a warmup to look at how we can create a private method in a class and how we can call that method internally.
The first main exercise explores the "static" keyword and how it works on a class with a static method.
The second exercise has us explaining the prototype chain of a class, it's sub-class, and the normal and static properties and methods. We spend a lot of time making sure we understand the entire chain.
The third main exercise has us looking through the Array Object documentation together to look up static and normal methods and properties and how they might work.
We wrap up the exercises with an open-ended Bonus question where we discuss where we'd use the static keyword and private identifier in our own class and object designs.
Chapters:
00:00 Introduction
00:55 Warmup Exercise - Private Method
06:49 Exercise 1 - Static Method
19:58 Exercise 2 - Explaining Prototypes
45:44 Exercise 3 - Array Class Documentation
55:50 BONUS - When to use static and private?
1:05:12 Next Steps
We start with a warmup to look at how we can create a private method in a class and how we can call that method internally.
The first main exercise explores the "static" keyword and how it works on a class with a static method.
The second exercise has us explaining the prototype chain of a class, it's sub-class, and the normal and static properties and methods. We spend a lot of time making sure we understand the entire chain.
The third main exercise has us looking through the Array Object documentation together to look up static and normal methods and properties and how they might work.
We wrap up the exercises with an open-ended Bonus question where we discuss where we'd use the static keyword and private identifier in our own class and object designs.
Chapters:
00:00 Introduction
00:55 Warmup Exercise - Private Method
06:49 Exercise 1 - Static Method
19:58 Exercise 2 - Explaining Prototypes
45:44 Exercise 3 - Array Class Documentation
55:50 BONUS - When to use static and private?
1:05:12 Next Steps
Комментарии