In this video Emmanuel Henri adds types into the functions of the application.
- [Instructor] The next step is…to properly add types to your functions,…which we have a few throughout our application.…So let's go ahead and explore this.…So the first thing you want to do,…if you don't have it open, is open your index.ts.…And then what we'll do is add a few variables…that we'll leverage when we do the function.…So the first one we'll do,…let me just clean that up a little bit.…I'll remove this,…feel free to keep it in your own application,…and then I'm going to add a few strings.…So let's clean that up a little bit.…I will remove the notes on this one,…just to clean the application clean.…
And then let's remove the notes here.…And then let's add a few variables.…So the first one will be mlabUser,…and we expect this one to be a string.…And then we'll pass the mlabUser.…So in this case, I'm going to copy linkedintest.…And then let's create another variable, mlabPass,…for password, which we also expect a string.…And then I'm going to pass the password.…
And by the way, if you try those,…when the course is over, these are going to be removed.…
Released
12/5/2018- TypeScript file conventions
- Using types in Node.js
- Adding types in your functions
- Using TypeScript classes in Node.js
- Using an interface in Node.js
- Using tools to organize your code
- Declaration merging
- Leveraging decorators in your Node.js application
Share this video
Embed this video
Video: Adding types in your functions