The setMonth() method sets the month of a date object (0-11):

Example

const d = new Date();
d.setMonth(11);



Practice Excercise Practice now