switch(n){ case 0 : function a() { }; break; case 1 : function b() { }; break; case 2 : function c() { }; break }