Question from the Javascript test

What will be the first thing that the following code displays?

Hard

What will be the** first thing** that the following code displays?

function Item() {
  this.name = 'item';
};
Item.prototype.take = function() {
  console.log('You can take' + this.name);
};

function Lantern() {
  this.name = 'lantern';
  this.light= function() {
    console.log('Light the' + this.name);
  }
};
Lantern.prototype = Object.create(Item.prototype);
Lantern.prototype.constructor = Lantern;

var lantern = new Lantern();
setTimeout(lantern.light, 1);
lantern.take();
Author: Jean-marie CléryStatus: PublishedQuestion passed 2050 times
Edit
2
Community Evaluations
developer avatar
Obsolete
Benoit
17/09/2024
cette question était obsolète il y a 8 ans