JavaScript
Dateオブジェクトの日付を 0 にすると、前の月の最終日になることを利用します。 let date = new Date() let year = date.getFullYear() let month = date.getMonth() let month_days = new Date(year, month + 1, 0).getDate() console.log(month_days) 注…
Dateオブジェクトの日付を 0 にすると、前の月の最終日になることを利用します。 let date = new Date() let year = date.getFullYear() let month = date.getMonth() let month_days = new Date(year, month + 1, 0).getDate() console.log(month_days) 注…