Today's challenge involved transforming an array. Leetcode asked you to write a function that accepts an array and a transform function, and return an array who's elements have all been transformed accordingly. In my opinion the cleanest way to do this is with the Array.map() method. The map method is passed a function, which is applied to each element of the array. The problem can be solved in a single line of code, with "return arr.map(fn)"
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