//Hi there
//We can enumerate through an object using for in loop
//For Example
const circle2 = {
radius: 10,
draw() {
console.log("draw");
},
};
//For enumeration, we will use for in loop
for (let key in circle2) {
console.log(key, circle2[key]);
}
//We will get the results of properties and their values on the console.
//But how can we enumerate when we define and object using constructor function ?
//Like this.
function Circle2(radius) {
this.radius = radius;
this.draw = function () {
console.log("draw");
};
}
//For in loop is not working here so plz tell me how to enumerate this ?