Task tempalte

### **Summary**

Task 14: People Interface. Introduced a reusable Person interface and updated relevant functions (createPerson, movePerson) to use it.

---
### **Task**

Task 14: People interface

Tip: <https://www.w3schools.com/typescript/typescript_aliases_and_interfaces.php>

We will be using the person object from task 12 a lot, so let's create an interface for it.

No functions needed, just the interface for the person object.

Update the person functions from task 12 and 13 to use this interface.

---
### **Method**

Created a new file people-interface.ts and added the Person interface with the following structure:

```bash
export interface Person {
  name: string;
  age: number;
  city: string;
}

Updated createPerson and movePerson functions from Tasks 12 and 13 to use the imported Person type from the interface.

This makes the type structure reusable across the project and future-proofs our work as new person-related functionality is added.


Reflection

Implementing the Person interface reinforced the value of strong typing in TypeScript. By centralizing our type definition, we reduce the chance of inconsistencies and bugs caused by manually repeating the same shape in multiple places.


Screenshot

image


How to use

Examples:

import { createPerson, movePerson } from './person-functions';

const person = createPerson('Alice', 30, 'New York');
const movedPerson = movePerson(person, 'Los Angeles');

Resources

https://www.w3schools.com/typescript/typescript_aliases_and_interfaces.php