Skip to main content

Practice ยท 1 of 3

Script Attribute Classifier

Write scriptBehavior(attrs) โ€” attrs is a string like "src=app.js" optionally containing "defer" or "async". Return "blocking" for plain scripts (download + execute pause parsing), "defer" for defer (parallel download, runs after parse), "async" for async (parallel, runs when ready), and "inline" when there is no src.

Difficulty: intermediate

Back to lesson: Practice: Waterfall & Blocking โ€” Practice