<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body></body>
<script>
//利用数组字面量创建数组
let arr = [];
//上面这段是使用数组字面量创建一个空数组
let brr = ["值", 1, "值", true, "值", undefined];
//上面这段是使用数组字面量创建一个带初始值的数组
console.log(arr);
console.log(brr);
//控制台显示的是==>>length: 0 0: "值" 1: 1 2: "值" 3: true 4: "值" 5: undefined length: 6
</script>
</html>
运行结果