Skip to content

Instantly share code, notes, and snippets.

@teasmade
Created September 12, 2024 10:06
Show Gist options
  • Save teasmade/31f0183fba7887db62e2ce1f80624600 to your computer and use it in GitHub Desktop.
Save teasmade/31f0183fba7887db62e2ce1f80624600 to your computer and use it in GitHub Desktop.
WCS TS Q2
// challenge.ts
interface User {
name: string;
age: number;
birthday?: string;
}
const prettyPrintWilder = (users: User[]): void => {
users.map((user) => {
console.log(`${user.name} is ${user.age} years old`);
});
};
const wilders: User[] = [];
const user1 = { name: "Pierre", age: 23 };
const user2 = { name: "Paul", birthday: "10/02/1990", age: 23 };
const user3 = { name: "Jacques", age: 25 };
wilders.push(user1);
wilders.push(user2);
wilders.push(user3);
prettyPrintWilder(wilders);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment