//使用new Date(year,month,0)的方式,可以获取该月的最后一天
var lastDay= new Date(2020,5,0).getDate()  //31