var ChuckBerry = { track: " Johnny B. Goode", song : function() { pet.debug("The " + hero.type + " likes " + this.track); return this.track; } }; console.log(ChuckBerry.song());
console output:
The captain likes Johnny B. Goode Johnny B. Goode
Short answer: No
I think the self and hero are only the same if you use it like this:
self.moveXY(22, 22) hero.moveXY(22, 22)
self.moveXY(22, 22)
hero.moveXY(22, 22)
I must admit I do not understand this… I’m sure you’re right, but I just don’t get how that would say so. It looks like nice code, javascript always looks very fancy