let obj = { name: 'smy', age: '18', job: 'engineer', * [Symbol.iterator]() { const self = this; let keys = Object.keys(this); let len = keys.length; for(let i = 0; i < len; i++){ yield {value: self[keys[i]]} } } }; for(let val of obj){ console.log(val) }