Created
January 28, 2019 18:30
-
-
Save considine/4acdbd277e36de4a3e5dd5617b91093a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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