toFunction
toFunction
JavaScript
String.prototype.toFunction=function(){return eval('('+this+')')};
var show = 'function(name){alert( name+":您好!")}'.toFunction();
show('校长');
String.prototype.toFunction=function(){return eval('('+this+')')};
var show = 'function(name){alert( name+":您好!")}'.toFunction();
show('校长');