Reputation: 1
shouldn't it be able to access the object "something"?
var problem = {
something: {thing:23},
somethingElse: [function(){return this.something.thing}]
};
console.log(problem.somethingElse[0]()); //Gives undefined error
I tried to access an object property from a function located within an array of functions, but it looks like it's not within the scope of the function. why is this?
Upvotes: 0
Views: 23