const mydate = new Date('2023,1,18');
console.log(mydate.toDateString());
This code results in
Wed Jan 18 2023
whereas
const mydate = new Date(2023, 0, 18);
console.log(mydate.toDateString());
also gives an output
Wed Jan 18 2023
But
const mydate = new Date('2023,0,18');
console.log(mydate.toDateString());
is invalid for this case why?