Seeking assistance with transitioning JavaScript code to TypeScript.
const profiles = [{
name: "kamal",
age: "20",
designation: "developer",
grade: "A",
},
{
name: "arun",
age: "25",
designation: "developer",
grade: "A",
},
{
name: "chan",
age: "23",
designation: "developer",
grade: "A",
},
];
function profileLookup(name, prop) {
for (let i = 0; i < profiles.length; i++) {
if (profiles[i].name === name) {
if (prop in profiles[i]) {
console.log(profiles[i][prop]);
}
}
}
}
profileLookup("arun", "age");