The above description is pretty clear, however, if you are like me, maybe the code below can help you get the big picture.
For example, in your project there is a lodash package, you import and use its method.
import random from 'lodash/random'; const result = random(????);
You can stop and ask how many parameters this method may require? and what is the data for each parameter? You should find the lodash homepage, find the random API documentation to know how to use it. After completing a bunch of tasks, you can specify the wrong order of parameters, but nothing will be displayed until you start your application and get an error.
This is where DefinitelyType shows its strength. After Installing Definitely Lodash Type
yarn add @types/lodash
- when you start to enter a
random method, a tooltip will show how to use the parameters. - if you provide the wrong parameter data type, it will show an error so that you know and correct it immediately.
Does this make sense? if not, donβt worry, turn off the music and listen to this video , Iβm sure you will understand it.
Tatsu
source share