-
-
Save codecademydev/321c5e9a67dc9cd493458296a9816b4c to your computer and use it in GitHub Desktop.
Codecademy export
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
// Our person constructor | |
function Person (name, age) { | |
this.name = name; | |
this.age = age; | |
} | |
// Now we can make an array of people | |
var family = new Array(); | |
family[0] = new Person("alice", 40); | |
family[1] = new Person("bob", 42); | |
family[2] = new Person("michelle", 8); | |
family[3] = new Person("timmy", 6); | |
// add the last family member, "timmy", who is 6 years old | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment