JS的undefined(未定义的)数据类型
作者:互联网
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script>
// undefined场景1
var a;
console.log(a,typeof a) // undefined 'undefined' #未定义的
// undefined场景2
function foo() {
}
var ret = foo()
console.log(ret) // undefined
</script>
</head>
<body>
<h1>welcome to JS!</h1>
</body>
</html>
标签:console,undefined,未定义,数据类型,ret,JS,var 来源: https://www.cnblogs.com/A121/p/16335475.html