Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js loop through object

const obj = { a: 1, b: 2, c: 3 }

for (const [key, value] of Object.entries(obj)) {
	console.log(key, value)
}
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #js #loop #object
ADD COMMENT
Topic
Name
9+4 =