var RPGConfig = (function() {
var Constructor = function() {
this.dir = "js";
this.enginedir = "js/Engine";
};
Constructor.prototype = {
include: [
this.dir + "/Common.js",
this.dir + "/Common/Class.js"
],
test: function() {
alert(this.dir);
}
};
return Constructor;
})();
rpgConfig = new RPGConfig();
rpgConfig.test();
console.log(rpgConfig.include);
So, if I run rpgConfig.test (), a warning will appear with "js". Large! But, my rpgConfig.include appears with "undefined", where this.dir should print "js" (as it was in test ()) ...
So, how do I add the scope of this to the array literal?
thanks
source
share