TGViewer
JavaScript JavaScript @javascript · 31K subscribers
Post #1431 6.62K
CHALLENGE

const obj1 = { a: 1 };
const obj2 = Object.create(obj1);
obj2.b = 2;

console.log(obj2.a, obj2.b);
console.log(obj2.hasOwnProperty('a'));
console.log(Object.getPrototypeOf(obj2) === obj1);
  • 👍 9
  • ❤ 2
More from @javascript
  1. Oct 18, 2026Post #3568
  2. Oct 18, 2026CHALLENGE class Counter { #count = 0; get value() { return this.#count; } set value(v) { i…
  3. Oct 17, 2026Post #3566
  4. Oct 17, 2026CHALLENGE async function run() { const results = await Promise.allSettled([ Promise.resolv…
  5. Oct 16, 2026Post #3564
  6. Oct 16, 2026CHALLENGE const x = 0; const y = ''; const z = null; const r1 = x ?? y ? 'A' : 'B'; const…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →