Jun 18, 2023
Yes, you're right, we can write it as your saying. But, in that case we can only pass`Person` type objects to the `logPerson` function.
The purpose of adding a Generic here is to bring flexibility. This way function can take any kind of object as param besides `Person` that has name and age properties.