JSFiddle - React, Tailwind, and code Playground

by Vladymyr Shevchuk

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'