Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Loop through object key that contains an iterable value

const person = {
	name: 'name',
    age: 30,
    hobbies: ['Baseball', 'Woodworking']
}

for (const hobby of person.hobbies) {
	console.log(hobby)
}
Source by forum.freecodecamp.org #
 
PREVIOUS NEXT
Tagged: #Loop #object #key #iterable
ADD COMMENT
Topic
Name
3+6 =