<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=GBK"> <title>Untitled Document</title> </head> <body> <script type'text/javascript'> var add=new Function("x,y","var sum;sum=x+y;return sum;"); // alert(add(3,4)); function add2(x,y){ var sum=x+y; return sum; } </script> <script type="text/javascript"> //匿名函数 var sum=function(a,b){ return a+b; } // alert(sum(3,22)); function haha(){ alert("haha run"); } var xixi=haha; </script> <script type="text/javascript"> function max(arr){ var max=0; for(var x=1;x<arr.length;x++) { if(arr[x]>arr[max]) max=arr[x]; } return arr[max]; } var arr=[3,5,2,5,1,33,11]; var max1=max(arr); //alert(max1) </script> </body> </html>