有没有区别:
var samples = {
"TB10152254-001": {
folderno: "TB10152254",
ordno: "001",
startfootage: "",
endfootage: "",
tagout: "Y"
},
"TB10152254-002": {
folderno: "TB10152254",
ordno: "002",
startfootage: "",
endfootage: "",
tagout: "Y"
},
"TB10152254-003": {
folderno: "TB10152254",
ordno: "003",
startfootage: "",
endfootage: "",
tagout: "Y"
}
};
和
var samples = new Array();
samples["TB10152254-001"] = {
folderno: "TB10152254",
ordno: "001",
startfootage: "",
endfootage: "",
tagout: "Y"};
samples["TB10152254-002"] = {
folderno: "TB10152254",
ordno: "002",
startfootage: "",
endfootage: "",
tagout: "Y"
};
samples["TB10152254-003"] = {
folderno: "TB10152254",
ordno: "003",
startfootage: "",
endfootage: "",
tagout: "Y"
};
编辑:
我将重新表述这个问题:如何动态填充散列?我不能做像 samples.TB10152254-003 这样的事情,因为我 TB10152254-003 是动态的……那么,这可能吗?