函数声明
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> </head> <body> <script type="text/javascript"> var n=100; /* f2=function(){alert(n);} function f3(){alert(n);} f2();//100 f3();//100 */ function F1(){ f2=function(){alert(n);} function f3(){alert(n);} f3();//100 } F1(); f2();//100 f3();//未定义 </script> </html>