Today's Leetcode challenge asked you to make a function that returns an object. This object has three simple methods that increment, decrement, and reset a variable that is passed as an argument when the object is instantiated. I chose to do this by declaring the three functions within the body of the outer function, along with a counter variable initially set to equal the initializer variable. An object is then returned, with its keys defined as the names of the functions and the values set to those functions. Objects in JS can be returned using the curly brace notation.
Subscribe to:
Post Comments (Atom)
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...
-
The CodeHawks platform has an upcoming audit on the Sablier protocol, so I decided to read through the docs and familiarize myself with the...
-
The ZKasino project recently exit scammed over 33 million dollars worth of Ethereum. he recent debacle surrounding ZKasino offers valuable...
-
In addition to its native SDK, Hedera also supports smart contracts in a platform compatible with the Ethereum Virtual Machine. This allows ...
No comments:
Post a Comment