Question d’entretien chez LinkedIn

var X = function(someValue){ this.hello = function(){ return someValue; }; }; X.prototype.test = function(){ return this.someValue; }; var x = new X("hi"); ------ what will the following code return? alert(x.hello()); alert(x.test());

Réponse à la question d'entretien

Utilisateur anonyme

28 juil. 2010

alert(x.hello()); -->return "hi" alert(x.test()); --> undefined

9