You can iterate over the properties of a plain object using several methods. The most common one is:
for...in loop: It iterates over all enumerable properties of an object, including those in the object's prototype chain. You can use hasOwnProperty() to filter out properties from the prototype chain.
Example:
const Person = { name: 'Ram', age: 25 };
for (let key in Person) {
if (Person.hasOwnProperty(key)) {
console.log(key + ': ' + Person[key]);
}