<!DOCTYPE html>
<html>
<head>
<script>
var age= 15;
function smile()
{
test(); // 调用成功,不需要像C 那样提前声明 但因为没有传参数 输出undefined
console.log(weight); // undefined
console.log(window.height); // undefined
console.log(height); // Uncaught ReferenceError: height is not defined
var weight = 60;
}
function test(weight)
{
console.log(weight);
}
smile();
</script>
</head>
<body>
</body>
</html>