Saturday, May 13, 2023

127: JS Challenge 8

 Today we had to write a function that takes another function as an argument, and returns a new function that can be called only one and returns undefined on all subsequent calls. This can be accomplished with closure by declaring a boolean variable. The variable is checked, and if it is the first call we return the function and change the boolean, otherwise we return undefined. 

No comments:

Post a Comment

190: Sablier

 The CodeHawks platform has an upcoming audit on the Sablier protocol, so I decided to read through the docs and familiarize myself with the...