从性能的角度来看,哪个函数定义更好/更快?制作一个对象并为其添加功能,还是一个一个地制作功能?
var myCollection:Object = {
first: function(variable:int):void {
},
second: function(variable:int):void {
}
}
myCollection.first(1);
或者
private function first(variable:int):void {
}
private function second(variable:int):void {
}
first(1);