You may not ever want to instantiate an object, but that doesn't mean you don't want to use a preexisting one. In this video, learn about the static access modifier.
- [Instructor] Let's talk a little bit … about the static access modifier. … At its core what it means is that … we can only access ether a property of a method of a class, … not having it instantiated. … And it sort of becomes a utility function to a degree. … That's really how I think of static methods and properties. … Is they're there for context, they provide a utility. … And we use them, … but we don't actually instantiate them. … That's the intent. … So let's give an example. … I'll even go a little bit deeper … and give an example of how we can do some cool … object-oriented programming implementation … to give you an idea of how you might use static methods. … So if you remember earlier we have our Message class … that we defined. … And now we have this Messages, … which you would imagine would be an array of Messages. … Now let's say we wanted to create a static method. … We can with the keyword static … and let's say we want to return the valid Messages … which will just be defined as a value …
Skill Level Intermediate
TypeScript: Upgrades and Featureswith Emmanuel Henri1h 15m Advanced
TypeScript for Node.js Developerswith Emmanuel Henri1h 2m Intermediate
1. Classes in TypeScript
2. Inheritance in TypeScript
3. Access Modifiers in TypeScript
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.