Using for…in to Loop Over Object Properties in Javascript


The for…in loop iterates over all enumerable properties of an object.

Source Code

for (let key in person) {
  console.log(key, person[key]);
}
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments