Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

for of loop javascript

const people = [{ name: 'Karl', location: 'UK' }, 
                { name: 'Steve', location: 'US' }];

for (const person of people) {
    console.log(person.name); // "karl", then "steve"
    console.log(person.location); // "UK", then "US"
}
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #loop #javascript
ADD COMMENT
Topic
Name
9+9 =