Now have you learned about private and public.
I also want to turn name into a private property.
And now here we have a little bit of not really an issue but a little bit of inconvenience.
We have that name field here.
Then we get a value for it here in the constructor and then we stored that value for that field here
in the constructor in the field.
We can do that and it's certainly very clear what we're doing here.
But in a lot of use cases you'll have a lot of classes where all the properties you have all the fields
you have are initialized in the constructor and therefore often you might find yourself writing a couple
of properties a couple of fields like this at the top.
No matter if they're private or public.
And then you just repeat all of that down there in the constructor just to then initialize these values
here in the constructor function.
You don't have to do that.
Instead of doing this double initialization code here you can get rid of your field definitions up there
and now you see you would get an error but you can always get rid of this year and instead now simply
add the Axis modifier in front of the parameter.
So if it should be public at public let's say for the name we keep it public.
Now if it should be private at private.
Here you have to add public because this now is an explicit instruction for typescript that tells typescript
that you want to not just get these arguments here in the constructor but that you want to create properties
for this class with the exact same names and therefore here we should also rename n to name.
So did a name property is created on the create a class.
So this is simply a shortcut for this double initialization code here where you had to find your fields
and then stored the value.
Now we're doing it all in one go.
We defined which arguments to constructor takes and then for every argument which has such a access
modifier in front of it a property of the same name is created and the value for the argument is stored
in that created property.
So now we just have to fix our department creation here and add an idea because I added this new argument.
And now what you'll see is that that when we call describe down there and I do actually output the idea
there as well.
Maybe by changing this department to use a string literal here the part meant this dot idea.
And then here this dot name you will see that this all still works.
It compiles without errors here and here we get the output with our I.D. and with our name because of
that little shortcut we also say if some code for all of that.