DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>预解析时变量的优先级示例title>
<script>
alert("(1)该行运行结果为:" + a);
var a = 3;
alert("(2)该行运行结果为:" + a);
function a() {
alert(2);
}
var a = 6;
function a() {
alert(4);
}
alert("(3)该行运行结果为:" + a);
script>
head>
<body>
body>
html>
大家看看运行结果是什么?
| 留言与评论(共有 0 条评论) “” |