Please can somebody help me figure out what is wrong in this code : var myObject={name: function(){return "Michael";}(),age: 28,sayName: function(){alert(this.name + ":" + this.age);}(),specialFunction : function(){myObject=this;if(this==myObject)altert(console.log(this.sayName));}}()};
please can somebody help me figure out what is wrong in this code. I am trying to call the methods of an object from other methods in the same object but I'm just getting undefined.
I'm thinking that inner scope object are allowed to access outer scope objects but this case disregards that rule. Thanks in advance.