Ext.overload (javascript Function overloading)

Ext.overload (javascript Function overloading)

Here is an addition for the Ext framework that may be of interest.

It permits javascript function overloading (yes, constructors too) as found in other programming languages (PHP, C++, Python, etc). For performance reasons, this implementation permits selective function invokation based on the number(only) of parameters passed as arguments.

//use the overloaded constructor for the familyvar family = new Person({name:'Dan',age:30},['Tommy', 'Sally']);console.log( family.kids[0].sayName()) ;family.sayName(1, console.log); //log Sally to the console