gpt4 book ai didi

javascript - 二维数组中的 "cannot read property 0 of undefined"

转载 作者:搜寻专家 更新时间:2023-11-01 05:26:01 24 4
gpt4 key购买 nike

有谁知道为什么会报错?我已经尝试了太久,我似乎无法弄清楚。它错误为“无法读取未定义的属性 0”,但已明确定义。 (或者我认为)

var categorySix = [["test"]["test2"],["testing"]["one"],["two"]["three"]];
document.write(categorySix[0][0]);

最佳答案

var categorySix = [["test","test2"],["testing","one"],["two","three"]];

你的语法不对。

关于javascript - 二维数组中的 "cannot read property 0 of undefined",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6597934/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com