Practice ยท 2 of 2
Lazy-Load on Visibility
Model IntersectionObserver. Write createLazyLoader() returning { observe, intersect } โ observe(el, onLoad) registers an element with a pending state; intersect(el) simulates it entering the viewport: the FIRST call marks it loaded, fires its onLoad(el) exactly once, and returns true; subsequent intersects return false and do nothing. Unknown elements return false.
Difficulty: intermediate
Press Submit to check your solution.
Back to lesson: Practice: Timers & Observers โ Practice