this part of the code from the link above is giving me trouble. background: running in a chrome extension under "use strict" conditions
var Greeter = function(strategy) {
this.strategy = strategy;
};
// Greeter provides a greet function that is going to
// greet people using the Strategy passed to the constructor.
Greeter.prototype.greet = function() {
return this.strategy();
};
I think i need to Create the property 'greet' but don't know how to.
I keep getting error saying "cannot set property 'greet' of undefined"
How can I create the property greet and get the code to work?
Thanks!
Aucun commentaire:
Enregistrer un commentaire