function foo1(a) { console.log( a + b ); } var b = 2; foo1( 2 ); // 4 理解:在调用foo1()之前已经全局声明了b。故在执行foo1()时b已经声明过。猜想:js只有在调用函数时才会执行声明函数。