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

function Vehicle(type) {
this.type = type;
}

Vehicle.prototype.wheels = 4;
Vehicle.prototype.getInfo = function() {
return `${this.type}: ${this.wheels}`;
};

const car = new Vehicle('Car');
const bike = Object.create(car);
bike.type = 'Bike';
bike.wheels = 2;

console.log(car.getInfo() + ' | ' + bike.getInfo());

Ответ: Car: 4 | Bike: 2

JavaScript test | #JavaScript & Max
More from @js_test
  1. Sep 27, 2026❗️Что будет на выходе: function processConfig(config) { const cache = config.cache ?? true…
  2. Sep 27, 2026Хочешь заговорить на английском, но не с кем практиковаться? Появилась ИИ-девушка, с котор…
  3. Sep 27, 2026❗️Что будет на выходе? const user = { profile: { name: 'Alice', settings: { notifications:…
  4. Sep 26, 2026❓Что будет на выходе? function recursivePascalTriangle(n, row = [1], triangle = []) { tria…
  5. Sep 26, 2026❗️Что будет на выходе: const regex = /a/g; const str = 'banana'; console.log(str.match(reg…
  6. Sep 26, 2026❗️Что будет на выходе: class MyClass { constructor() { this.a = 100; } } MyClass.prototype…
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 →