SOURCE

function writeDocument(variable) {
    document.write(variable + "<br/>");
} 
writeDocument("数组创建---------")
var arr = ["HTML","CSS","JavaScript","jQuery","Vue.js"];

writeDocument(arr);

writeDocument("数组下标取值-------------")
writeDocument(arr[2]);

writeDocument("数组赋值--------------")

arr[4] = "React.js";

writeDocument(arr);

arr[5] = "Vue.is";

writeDocument(arr);

arr[8] = "Angular.is";

writeDocument(arr);
console 命令行工具 X clear

                    
>
console