TypeScript generics come in handy when you have similar lists that you need to convert to dictionaries. Consider the following lists:
const idList = [
{ id: "0001", firstName: "Levi", lastName: "Ackerman" },
{ id: "0002", firstName: "Mikasa", lastName: "Ackerman" },
{ id: "0003", firstName: "Eren", lastName: "Yeager" },
{ id: "0004", firstName: "Armin", lastName: "Arlert" },