JSFiddle - React, Tailwind, and code Playground
JavaScript
const parent = {
color: 'red'
};
const child = {
fruite: 'apple'
};
child.__proto__ = parent;
for (const prop in child) {
if (child.hasOwnProperty(prop)) {
console.log(child[prop]);
}
}
// 'apple'