我有以下 JavaScript 数组:
var days = [
{
"day": "sunday",
"morning": "geschlossen",
},
{
"day": "monday",
"morning": "geschlossen",
},
{
"day": "tuesday",
"morning": "geschlossen",
},
{
"day": "wenesday",
"morning": "geschlossen",
},
{
"day": "thursday",
"morning": "16:30 - 19:00 Uhr",
},
{
"day": "friday",
"morning": "09:00 - 18:00 Uhr",
},
{
"day": "saturday",
"morning": "geschlossen",
}
];
如何更改0th index object
数组中的最后一个值?
所以我预期的数组将是这样的:
var days = [
{
"day": "monday",
"morning": "geschlossen",
},
{
"day": "tuesday",
"morning": "geschlossen",
},
{
"day": "wenesday",
"morning": "geschlossen",
},
{
"day": "thursday",
"morning": "16:30 - 19:00 Uhr",
},
{
"day": "friday",
"morning": "09:00 - 18:00 Uhr",
},
{
"day": "saturday",
"morning": "geschlossen",
},
{
"day": "sunday",
"morning": "geschlossen",
}
];
我玩过拼接和流行音乐,但没有达到预期的效果。