JSFiddle - React, Tailwind, and code Playground
JavaScript
const post = { name: "Lalka", age: 15 };
post[Symbol.iterator] = function *(){
const properties = Object.keys(this);
for (let p of properties) {
yield this[p];
}
}
for (let p of post) {
alert(p);
}