Methods are functions that belong to your objects. In this video, learn how to use them properly in this video.
- [Instructor] All right. Let's dive into methods. … Methods are nothing more than functions … that belong to our classes. … Let's check out a little bit of our setup here. … You see we have a title for a new course. … I've sent out numerous sort of email promotions … for my own courses, as well as for businesses. … So you might get something like a title, … "Hey, you know, new course, just 9.99." … And then in the content you get a, … "Oh, check out the latest course … on object oriented program with TypeScript." … Now let's say that we had a preview message method, … which all it would do would take … the first 10 characters of our message here … and then put ... to sort of intrigue you. … What would that look like in TypeScript? … So we'll start off by writing a previewMessage … and we're not going to have any parameters on here, … but what we are going to have is a return type of a string. … So much like how our properties and our parameters … can have type, so can our return. … You can see here that what we're returning …
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.