TGViewer
JavaScript test JavaScript test @js_test · 9.71K subscribers
Post #5736 543
❗️Что будет на выходе:

const user = {
name: 'Sarah',
age: 25,
getName() { return this.name; },
getAge: () => this.age
};

const methods = {
regular: user.getName,
arrow: user.getAge
};

console.log(methods.regular());
console.log(methods.arrow());
console.log(user.getName());
console.log(user.getAge());

Ответ: undefined undefined Sarah undefined

JavaScript test | #JavaScript
More from @js_test
  1. Oct 6, 2026❓Что будет на выходе? const compose = (...fns) => fns.reduce((f, g) => (...args) => f(g(..…
  2. Oct 6, 2026❓Что будет на выходе? 'use strict'; function strictModeExample() { undeclaredVariable = 10…
  3. Oct 5, 2026❗️Что будет на выходе? function* genSequence() { const result = yield 'first'; console.log…
  4. Oct 5, 2026❗️Что будет на выходе: function trickyScope() { let x = 10; if (true) { let x = 20; consol…
  5. Oct 5, 2026❓Что будет на выходе? 'use strict'; function strictModeExample() { undeclaredVariable = 10…
  6. Oct 3, 2026❗️Что будет на выходе: function multiply(a, b) { if (b === 0) { return 0; } else if (b > 0…
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 →