javaScript中变量会被提前声明
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>javaScript中变量会被提前声明</title>
<script type="text/javascript">
//js里面,变量会被提前声明
console.log(a);
var a = function b(){return '88';};
console.log(a);
console.log(a());
//js里面,变量会被提前声明
console.log(c);
var c = 66;
console.log(c);
//d这个变量没有定义,当然会报错了
console.log(d); //d is not defined
</script>
</head>
<body>
<h1>javaScript中变量会被提前声明</h1>
</body>
</html>
<script type="text/javascript">
var h;
console.log(h);
h = 99;
console.log(h);
</script>