Rabi Siddique
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.

--

--

Rabi Siddique
Rabi Siddique

Written by Rabi Siddique

A passionate Software Engineer who intends to be the best and nothing less.

No responses yet