This question has already been answered:
function Alarm(clock) { Clock.call(this, clock); this.clock.querySelector('.set-alarm').onchange = () => { let timer = clock.querySelector('.set-alarm').value.split(':'); let hour = timer[0]; let minute = timer[1]; let second = timer[2]; this.newDate = new Date(0, 0, 0, hour, minute, second).getTime(); }; console.log(second); } How to get the variable second or this.newDate so that you can output it to console.log?
console.log(this.newDate);like thisconsole.log(this.newDate);- Stepan Kasyanenkoonchangeevent isonchange, andconsole.logis called right away - ThisMan