A Tasty Treats Podcast for Web Developers.

Ask a Potluck Question โ†’
Wes Bos

Wes Bos

XL5G3 Full Stack JavaScript Developer. Creator of really good web development courses. BBQ enthusiast.

Scott Tolinski

Scott Tolinski

Web Developer, NX2V1, Creator of Level Up Tuts, Bboy, Robotops Crew and Youtuber

Playing: 367: Hasty Treat - JavaScript Event Buzzwords โ€” Sync, Concurrent, Defer, Blocking, Workers

0:00

LOUDNESS

Jul 5th, 2021

Hasty Treat - JavaScript Event Buzzwords โ€” Sync, Concurrent, Defer, Blocking, Workers

๐Ÿ‘‡ Download Showโœ๏ธ Edit Show Notes

In this Hasty Treat, Scott and Wes define some JavaScript Buzzwords and talk about what they mean!

Freshbooks - Sponsor

Get a 30 day free trial of Freshbooks at freshbooks.com/syntax and put SYNTAX in the "How did you hear about us?" section.

Sentry - Sponsor

If you want to know whatโ€™s happening with your code, track errors and monitor performance with Sentry. Sentryโ€™s Application Monitoring platform helps developers see performance issues, fix errors faster, and optimize their code health. Cut your time on error resolution from hours to minutes. It works with any language and integrates with dozens of other services. Syntax listeners new to Sentry can get two months for free by visiting Sentry.io and using the coupon code TASTYTREAT during sign up.

Show Notes

03:24 - Synchronous / Async

05:23 - Multi-threaded

  • JavaScript has a single "main thread"
  • But you can have more threads with web workers

08:12 - Blocking

  • JavaScript can stop other things on the page from running
  • A script tag can block HTML from being parsed
  • Most stuff in JavaScript is non-blocking
  • Node.js write to filesystem can be blocking

10:27 - Concurrent + Parallel

13:22 - Consecutive / Waterfall

  • One after another

13:48 - Callback

17:56 - Script Tag Async + Defer

  • Doesn't block other content
  • Runs when ready - doesn't care about DOMcontentLoaded
  • Wait until the page is loaded before running
  • If the script tag is above content, don't wait for it
  • Good for things that aren't called on page load

21:54 - Lazy

  • Load it in later - maybe when it's scrolled into view, or as needed
  • Not mission-critical

Tweet us your tasty treats!