TGViewer
JavaScript JavaScript @javascript · 31.1K subscribers
Post #3510 573
CHALLENGE

function Foo(x) {
this.x = x;
return { x: x * 2 };
}

function Bar(x) {
this.x = x;
return 42;
}

const f = new Foo(5);
const b = new Bar(5);

console.log(f.x, b.x, f instanceof Foo, b instanceof Bar);
More from @javascript
  1. Sep 22, 2026Post #3511
  2. Sep 21, 2026Post #3509
  3. Sep 21, 2026CHALLENGE console.log( typeof typeof 1, 1 + typeof 1, 2 ** 3 ** 2, 1 + 2 + '3', 1 < 2 < 3,…
  4. Sep 20, 2026Post #3507
  5. Sep 20, 2026CHALLENGE 'use strict'; function getValue() { return this.value; } const obj = { value: 42…
  6. Sep 19, 2026Post #3505
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 →