I will miss this series.I enjoyed more than learning..
@dmtetreau3 жыл бұрын
Built it this morning. Thanks!
@danbuild9776 жыл бұрын
This was sublime! Thank you once again.
@fandinurahmadhabibi27796 жыл бұрын
Awesome! One question, can we do something like pause and resume for this countdown timer?
@dhirajnarsinghani12234 жыл бұрын
-> first of all save the secondsLeft in global variable. -> When someone clicks the pause button, clearInterval. -> When someone clicks play/start button call timer(secondsLeft)
@FordExplorer-rm6ew5 жыл бұрын
Hey we likes the same music. I will forever miss that era
@PRANVIKASHA6 жыл бұрын
The reason setInterval is not reliable is because of the event loops in Javascript.. All the callbacks (event listeners, setInterval etc..) go into the callback queue and wait for there turn on the stack.. So anything in set interval is guaranteed to run after the interval (that's when its added to the queue) but not instantaneously.. It has to wait for its turn..
@FordExplorer-rm6ew5 жыл бұрын
Helpful
@sureshmangs48063 жыл бұрын
Best tutorial ever. Learnt a lot. Thanks
@marytmurray67014 жыл бұрын
The countdown timer in JavaScript works and announces result when active on the timer tab but when I switch to another tab while the timer is running, it starts from 59:59 and does not announce result. What am I doing wrong? help me out please.
@mirage47313 жыл бұрын
can you share the code !
@naguip915 жыл бұрын
Not only europeans, I'm pretty sure that the world except americans and canadians get it.
@tarunjindal29774 жыл бұрын
Hey,can anyone help me with implementing a pause function in this application?
@dhirajnarsinghani12234 жыл бұрын
-> first of all save the secondsLeft in global variable. -> When someone clicks the pause button, clearInterval. -> When someone clicks play/start button call timer(secondsLeft)
@RobVermeer7 жыл бұрын
A more elegant way to add the leading 0 to the seconds when < 10 to me would be to do seconds.toString().padStart(2, 0). Thanks for the video!
@eotikurac5 жыл бұрын
hey, first time being european came in handy hehe
@moshetzarfatipiano4 жыл бұрын
what should I add to get hours too?
@dhirajnarsinghani12234 жыл бұрын
const hours = Math.floor(seconds / 3600) ; seconds = seconds % 3600; const minutes = Math.floor(seconds / 60) ; const remainerSeconds = seconds % 60; use this in displayTimeLeft
@nathannagle62774 жыл бұрын
You'll also need to update the display: const display = `${hours}:${minutes < 10 ? '0' : ''}${minutes}:${remainderSeconds < 10 ? '0' : ''}${remainderSeconds}`;
what theme are you using? I tried cobolt2 but it nowhere does it look as pretty and vibrant as yours does on the screen :/ pls help
@michaelluevanos52935 жыл бұрын
the console logs aren't working
@Luuckx27 жыл бұрын
And a chronometer, how do?
@trongnguyenduy39363 жыл бұрын
Thanks
@radovansurlak74457 жыл бұрын
You're a BOS(S)! :)
@reactarabic57677 жыл бұрын
we canadians or americans or whoever else is normal 😂
@Jackolltradez Жыл бұрын
2023, Thank you.
@errorerror13376 жыл бұрын
Everything that happens now, is happening now. What happened to then? We passed it! When? Just now! We're at now, now. Go back to then! When? Now! Now? Now! I can't! Why? We missed it. When? Just now. When will then be now? Soon.
@prithweedas43637 жыл бұрын
instead of 'hour > 12 ? hour - 12 : hour' hour % 12 could do the same probably
@RobVermeer7 жыл бұрын
You actually cant, because 12 % 12 will result in 0, which you don't want to display at noon. You could however do (hour - 1) % 12 + 1. The reason -1 % 12 will not result in 11 (but -1) is because JS actually calculates the remainder, instead of the actual modulus =)
@Hammmmyy7 жыл бұрын
awesome
@boskoa.2290 Жыл бұрын
Taking a ciggie break while normies are finishing the date formatting. Great dead pan deliveries overall. That "When god created the earth" bit was on par with the "console.clear()" messing with developers joke.
@Thepineapplethief236 жыл бұрын
Thanks a lot for all your video's, they are really helpfull! I hope you can help me with looping your code?! I want setInterval starting a serverall times again. Thanks allready!! function timer(seconds){ let now = Date.now() let then = now + seconds * 1000 // setIntervall is een functie waarbij gekeken gaat worden wat de intervall is (=> staat vaak gelijk aan this) setInterval(() =>{ //Hier is de formulie die laat zien hoeveel tijd er nog is let secondsLeft = Math.round(then - Date.now())/1000 if(secondsLeft < 0){ //Opnieuw het beginnen, nieuwe variabele instellen let now = Date.now() let then = now + seconds * 1000 secondsLeft = Math.round(then - Date.now())/1000 } console.log(secondsLeft) //deze 1000 staat hier omdat we seconden willen laten zien }, 1000)
@SeeN0006 жыл бұрын
Hey, canadians and americans have to modify code further, not europeans ;)