Skip to content
JavaScript·Intermediate·Conceptual·1 min read

What do leading and trailing options mean?

Short interview answer

Leading invokes at the start of the window; trailing invokes with the latest arguments after the window. Enabling both requires careful state so a single call does not unexpectedly fire twice. The product interaction should determine the semantics.

Key takeaway

Explain the underlying mental model clearly, then support it with a concrete example and its trade-offs.

← Back to Debounce and throttle

Related questions