1interface LabelledValue {
2 label: string;
3}
4
5function printLabel(labelledObj: LabelledValue) {
6 console.log(labelledObj.label);
7}
8
9let myObj = {size: 10, label: "Size 10 Object"};
10printLabel(myObj);
11
1const user = {
2 firstName: "Angela",
3 lastName: "Davis",
4 role: "Professor"
5}
6
7console.log(user.firstName)
8Property 'name' does not exist on type '{ firstName: string; lastName: string; role: string; }'.2339Property 'name' does not exist on type '{ firstName: string; lastName: string; role: string; }'.Try