Congratulations on finishing Advanced Objects!
Let’s review the concepts covered in this lesson:
- The object that a method belongs to is called the calling object.
thiskeyword refers to the calling object and can be used to access properties of the calling object.
- Methods do not automatically have access to other internal properties of the calling object.
- The value of
thisdepends on where the
thisis being accessed from.
- We cannot use arrow functions as methods if we want to access other internal properties.
- The usage of an underscore before a property name means that the original developer did not intend for that property to be directly changed.
- Setters and getter methods allow for more detailed ways of accessing and assigning properties.
- Factory functions allow us to create object instances quickly and repeatedly.
- There are different ways to use object destructuring: one way is the property value shorthand and another is destructured assignment.
- As with any concept, it is a good skill to learn how to use the documentation with objects!
You’re ready to start leveraging more elegant code for creating and accessing objects in your code!
If you want to challenge yourself:
- Find the value of
thisin a function inside of a method.
- Learn the outcome of using a property that has the exact same name as a setter/getter method.
- Create a new factory function that can create object instances of your choice.
- Read documentation on other destructuring techniques and apply it to your code.
- Try out other built-in object methods and learn what they do.