I am having trouble with my constructor function and need help, here is what I have so far...
function EgyptianGoddesses(name, oversees, strength, weakness) {
this.name = name;
this.oversees = oversees;
this.strength = strength;
this.weakness = weakness;
return function() {
name,
oversees,
strength,
weakness
}
}
var maatCharacteristics = ['Maat', 'Truth and Justice', 'Balancing and Just', 'Exacting in her standards']
var maat = new EgyptianGoddesses(this.maatCharacteristics)
console.log(maat)
I am just getting an empty constructor, and I think it is something wrong with the return. Any help would be appreciated.
returnstatement.new EgyptianGoddesses(this.maatCharacteristics)You don't want thethishere, it works here only becausethiscontext is going to be global, and the var is currently global. Seen asmaatCharacteristicsis in scope, just donew EgyptianGoddesses(maatCharacteristics)