Answers for "for loop key value to object"

2

loop over keys in object javascript

Object.keys(obj).forEach(function(key) {
  console.log(key, obj[key]);
});
Posted by: Guest on March-03-2020
1

loop key in object

const fruits = { apple: 28, orange: 17 }

for(key in fruits){
	console.log(key)
}
Posted by: Guest on June-29-2020

Code answers related to "for loop key value to object"

Code answers related to "Javascript"

Browse Popular Code Answers by Language