Skip to main content

Practice · 3 of 3

Once-Only Handler

CHALLENGE
Difficulty: intermediate+25 XP

Write once(fn) that RETURNS a wrapper which calls fn with the FIRST invocation's arguments and returns its result; every later call RETURNS that same first result without running fn again. fn's this need not be preserved.

Back to lesson: Practice: Event Delegation — Practice