1
1) Comment créer un objet en passant des paramètres à un constructeur en utilisant Object.create() ?
7
meow : function(){console.debug(this.name + ": meow !")}
12
Create an object mike that inherits from horry and set its name to mike in one single call to Object.create.
14
2) What's wrong in the followwing code ?
17
person.prototype.foo = function (){console.debug("hehehe")}
22
me = Object.create(person);
23
me.foo(); // why can't me find foo even when it's defined in its prototype person.
25
3) What's wrong with this code ?
29
init : function(name){this.name = name; return this;}
32
jack = Object.create(howard).init("jack")
33
console.debug(jack.name);