teapawtteapawt
$
  • Timeline
  • Grid
  • Gallery
Sohel Mahmud (@FullStackScript) profile picture
Sohel Mahmud@FullStackScriptSep 21
Built a 12-hour digital clock in JavaScript today ⏰ What clicked: - setInterval waits before its 1st run - padStart() turns 5 into 05 - % and || convert 24h to 12h - return ≠ updating the screen #JavaScript #buildinpublic
2
4
58
Sohel Mahmud (@FullStackScript) profile picture
Sohel Mahmud@FullStackScriptSep 20
Today, I learnt two foundational time-based functions in JavaScript: setTimeout and setInterval. setTimeout(): Runs a function only once after a specified delay. Perfect for delayed UI popups.setInterval(): Runs a function repeatedly at fixed intervals.
1
24
Load more