Tuesday, May 16, 2023

130: Sleep

  Today's problem involved asynchronous programming, and writing a function that sleeps for a given number of milliseconds. Asynchronous programming is one of the major utilities of Javascript that makes it distinct from other languages. I solved this problem using a Promise. The promise accepts a callback function which executes some resolution function after waiting the given number of milliseconds. In this process I gained a stronger understanding of how promises work, along with their callback functions and resolution and rejection methods. 

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...