Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

loop through object js

var obj = {
  first: "John",
  last: "Doe"
};

//
//	Visit non-inherited enumerable keys
//
Object.keys(obj).forEach(function(key) {

  console.log(key, obj[key]);

});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #loop #object #js
ADD COMMENT
Topic
Name
9+7 =