配列の要素の一部を変更したいのですが、
32行目がエラーになってしまいます。
https://gyazo.com/fb9a3be484928df971ca3d8ea4f795b9
どのような原因がありますでしょうか?
ご教授お願い致します。
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> </head> <script> const today = new Date(); let year = today.getFullYear(); let month = today.getMonth(); function getCalendarBody() { const dates = []; // date: 日付, day: 曜日 const lastDate = new Date(year, month + 1, 0).getDate(); for (let i = 1; i <= lastDate; i++) { dates.push({ date: i, isToday: false, isDisabled: false, isReserve: false, }); } const t = today.getDate(); for (let i = t; i <= lastDate; i++) { dates[i].isReserve = true; } } getCalendarBody(); </script> </body> </html>
エラーが出たなら、エラーメッセージを提示しましょう
エラーメッセージは、よけいな省略翻訳しないで出たそのママをコピペで提示してください
回答1件
あなたの回答
tips
プレビュー