func('one'); function func(type) { name+{type}(); } function nameone () { ... } function nametwo () { ... }
func('one'); function func(type) { // name+{type}(); window['name'+type](); } function nameone () { alert('nameone '); } function nametwo () { alert('nametwo '); }
function func(type) { (window['name'+type]=function () { alert('name'+type); }());} func('one'); func('two');
function func(type) { (this['name'+type]=function () { alert('name'+type); }());} func('one'); func('two');