多维数组 - 无输出

时间:2017-10-15 11:47:13

标签: multidimensional-array

我正在使用Beginner Javascript这本书进行二维数组练习,但我没有输出浏览器中的代码。那是为什么?

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Chapter 2, Example 9</title>
    </head>
    <body>
    <script>
    var personnel = [];

    var personnel [0]  = [];
    var personnel [0] [0] = "Name0";
    var personnel [0] [1] = "Age0";
    var personnel [0] [2] = "Address0";

    var personnel [1]  = [];
    var personnel [1] [0] = "Name1";
    var personnel [1] [1] = "Age1";
    var personnel [1] [2] = "Address1";

    var personnel [1]  = [];
    var personnel [1] [0] = "Name1";
    var personnel [1] [1] = "Age1";
    var personnel [1] [2] = "Address1";

    document.write ("Name: " + personnel [1] [0] + "<br/>");
    document.write ("Age: " + personnel [1] [1] + "<br/>");
    document.write ("Address: " + personnel [1] [2] + "<br/>");

    </script>
    </body>
</html>

1 个答案:

答案 0 :(得分:1)

我认为是

sudo ./gradlew clean

不是

personnel [0]  = [];
personnel [0] [0] = "Name0";

One&#34; var&#34;