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

function X() {}
X.prototype.getValue = function() {
return this.value;
};

function Y() {
this.value = 42;
}
Y.prototype = Object.create(X.prototype);
Y.prototype.constructor = Y;

var y = new Y();
console.log(y.getValue());


Ответ: 42

JavaScript test | #JavaScript
More from @js_test
  1. Oct 14, 2026❗️Что будет на выходе: function processData({ a = 10, b = 20 } = { a: 30 }) { console.log(…
  2. Oct 14, 2026Как платить за границей и за зарубежные сервисы в 2026 году? Можно переплачивать посредник…
  3. Oct 14, 2026❗️Что будет на выходе: const person = { name: 'Alice', greet() { return `Hello, I'm ${this…
  4. Oct 14, 2026❗️Что будет на выходе: const regex = /a/g; const str = 'banana'; console.log(str.match(reg…
  5. Oct 13, 2026❓Что будет на выходе? const sym1 = Symbol('description'); const sym2 = Symbol('description…
  6. Oct 13, 2026❗️Что будет на выходе: function Animal(name) { this.name = name; } Animal.prototype.speak…
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 →