Skip to content

Instantly share code, notes, and snippets.

@considine
Created January 28, 2019 18:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save considine/4acdbd277e36de4a3e5dd5617b91093a to your computer and use it in GitHub Desktop.
Save considine/4acdbd277e36de4a3e5dd5617b91093a to your computer and use it in GitHub Desktop.
export interface IHuman {
name: string;
age: string;
location: string;
height: string;
}
function outputInformation(name: string, age: string, location: string, height: string, isMale: boolean = false) {
console.log(`Name: ${name}, Age: ${age}, Location: ${location}, Height: ${height}, isMale: ${isMale}`);
}
const humans: IHuman[] = [
{
name: "kyle",
age: "500",
location: "los angeles",
height: `6'3"`,
},
{
name: "tom",
age: "20",
location: "seattle",
height: `54"`
}
];
humans.forEach((human, index) => {
outputInformation(human.name, human.age, human.location, human.height, index % 2 === 0);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment