The for…in statement iterates over all the properties of an object that are strings.
for (var in object){
// statement goes here
}
const obj = { name: 'Nitesh', place: 'Bangalore', country: 'India' };
for (const prop in obj) {
console.log(prop +': ' + obj[prop]);
}
// expected output:
// "name: Nitesh"
// "place: Bangalore"
// "country: India"