Created
April 26, 2019 06:09
-
-
Save Tocacar/b0cb3a38575a834c0c4ae835b631f055 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
var people = [{ | |
name: 'anne', | |
pets: ['dog', 'cat'] | |
}, | |
{ | |
name: 'jim', | |
pets: ['dog'] | |
}, | |
{ | |
name: 'sam', | |
pets: ['rabbit', 'cat'] | |
}, | |
{ | |
name: 'kay', | |
pets: ['dog', 'hamster'] | |
}, | |
{ | |
name: 'olive', | |
pets: ['fish', 'cat'] | |
} | |
]; | |
for (let i = 0; i < people.length; i++) { | |
console.log(people[i].name); | |
for (let j = 0; j < people[i].pets.length; j++) { | |
console.log(people[i].pets[j]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment