Skip to main content

Practice ยท 3 of 3

Once-Only Handler

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.

Difficulty: intermediate

Back to lesson: Practice: Event Delegation โ€” Practice