Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript iterate object attribute name

var obj = {
	name: 'John doe',
	age: '25'
}

for (prop in obj) {
	console.log(prop) // Gives back 'name' and 'age'
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #iterate #object #attribute
ADD COMMENT
Topic
Name
6+8 =