Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardJavaScriptprototype chain internalsSingle-choice MCQ

What does this print, given how `__proto__` assignment versus the prototype chain works?

const parent = { greet() { return 'hi'; } }; const child = {}; child.__proto__ = parent; console.log('greet' in child); console.log(child.x);