9951 explained code solutions for 126 technologies


javascriptHow to iterate through object properties


for (var prop in obj) {
  if ( Object.prototype.hasOwnProperty.call(obj, prop) ) {
    console.log(prop + ': ' + obj[prop]);
  }
}ctrl + c
for (var prop in obj)

cycle to iterate every obj object property

Object.prototype.hasOwnProperty.call

this will exclude possible native properties of an object

console.log(prop + ': ' + obj[prop])

replace with your code to operate over obj properties