次の 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",
}
];
スプライスとポップをいじってみましたが、意図したとおりにはなりませんでした。