Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

array-object loop

const data = [
  { name: 'John', age: 30, group: 'A' },
  { name: 'Mary', age: 25, group: 'B' },
  { name: 'Mike', age: 20, group: 'A' },
  { name: 'Jane', age: 15, group: 'C' },
  { name: 'Peter', age: 25, group: 'B' }
];

// for loop
for (let i = 0; i < data.length; i++) {
  console.log(data[i]);
}
Source by www.tutorialstonight.com #
 
PREVIOUS NEXT
Tagged: #loop
ADD COMMENT
Topic
Name
6+4 =