Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript looping through object

for (const [fruit, count] of entries) {
  console.log(`There are ${count} ${fruit}s`)
}

// Result
// There are 28 apples
// There are 17 oranges
// There are 54 pears
Source by zellwk.com #
 
PREVIOUS NEXT
Tagged: #javascript #looping #object
ADD COMMENT
Topic
Name
5+7 =