Today I Learned - Rocky Kev

Tagged “objects”

  1. TIL fancy methods to transform Javascript Objects

    You can use Object.entries(), Object.keys(), Object.fromEntries()...

  2. TIL a neat way to clone and object and override the items

    Spread the object into a new object, then override the element later.

  3. TIL You can dynamically name objects

    Not all Object keys have to be hard-coded strings. To make it dynamic, use [brackets].

  4. TIL adding properties conditionally using the spread syntax

    You can conditionally add properties to objects by ... in there.

  5. TIL using Object.freeze to simulate enums in Javascript

    Enums are useful to assign names to the integral constants which makes a program easy to read and maintain. The keyword 'enum is used to declare an enumeration.

  6. TIL not using the delete keyword for performance issues

    The delete keyword is used to remove a property from an object. Apparently, there is performance issues with `delete` with V8 Javascript Engine.

  7. TIL Deconstructing Objects

    Rather than create a big list of parameters in your function, pass the whole object and deconstruct it.

  8. TIL Using Set and Map

    Differences between Arrays/Set & Objects/Map

See all tags.