Create Date with Arguments
Browsers parse date string differently. So creating a new date using a string will cause an error due to confusion between local time and UTC time.1
// don't use thisconst date = new Date('2020-12-31')// use thisconst date = new Date(2020, 11, 31)