setDate date functionBy using setDate we can add date to any date object. This function can take numeric value 1 to 30 depending on the month and display the date accordingly. The code below will display 15th day of the current month.
var dt= new Date();
The output of this will be
What happens when we add more that 30 or 31st day to the date function. This will take us to future date starting from 1st day of the current month.