在 JavaScript 脚本中,我创建了以下字典。
var dictionary =[];
$(function () {
dictionary.push({
key: @item.Key.ToShortDateString().ToString(),
value: @Html.Raw(JsonConvert.SerializeObject(item.Value)),
});
alert(dictionary['2017-09-19']);
});
在弹窗中,它显示为 undefined
。我该如何从此字典中读取值?