Undefined 类型:对未初始化的变量执行 typeof 操作符会返回 undefined 值,而对未声明的变量执行 typeof 操作符同样也会返回 undefined 值

2017-06-14 14:06:00
admin
原创
425
<!DOCTYPE html>
<html>
	<head>
		<title>
			Undefined Example 4
		</title>
		<script type="text/javascript">
			var message; //this variable is declared but has a value of undefined
			//make sure this variable isn't declared
			//var age
			alert(typeof message); //"undefined"
			alert(typeof age); //"undefined"
		</script>
	</head>
	<body>
	</body>
</html>
  • QQ讨论群
  • 关注微信
    • 欢迎咨询
    • 欢迎加入QQ群 16506021
  • 公众号:源宝网络