最佳答案
我的代码:
var a = "1",
b = "hello",
c = { "100" : "some important data" },
d = {};
d[a]["greeting"] = b;
d[a]["data"] = c;
console.debug (d);
我得到以下错误:
未捕获的 TypeError: 无法设置未定义的属性“问候语”。
我正在尝试做一些类似于关联数组的东西。为什么这个不起作用?