I wanted to know what is computationally the fastest way to call a function nested in an object, so I made a quick jsPerf.com benchmark where I have considered three possibilities - calling a function from an array, from a 'core' object and from a function object:
var array = [1, 1, function(number) { return number; }];
var funcObj = function() {
this.one = 1;
this.two = 2;
this.three = function(number) { return number; };
}
var someFunc = new funcObj();
var obj = {
one: 1,
two: 1,
three: function(number) { return number; }
}
This is what happened:

And now, the question is: why there is so big difference?
EDIT: Link to the benchmark: >> link <<