TGViewer
JavaScript JavaScript @javascript · 31K subscribers
Post #2068 5.89K
CHALLENGE

function Person(name, age) {
this.name = name;
this.age = age;
}

Person.prototype.getDetails = function() {
return this.name + ' is ' + this.age + ' years old.';
};

const john = new Person('John', 25);
console.log(john.getDetails());
  • 👍 11
  • ❤ 1
More from @javascript
  1. Oct 10, 2026Post #3550
  2. Oct 10, 2026CHALLENGE async function main() { const settled = await Promise.allSettled([ Promise.resol…
  3. Oct 9, 2026Post #3548
  4. Oct 9, 2026CHALLENGE const a = -7 % 3; const b = 7 % -3; const c = 2 ** 3 ** 2; const d = (2 ** 3) **…
  5. Oct 8, 2026Post #3546
  6. Oct 8, 2026CHALLENGE function tag(strings, ...values) { return strings.raw.join('|') + '::' + values.…
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 →