The setSeconds() method sets the seconds of a date object (0-59):

Example

const d = new Date();
d.setSeconds(30);



Practice Excercise Practice now