Tag "JavaScript" (7 posts)

  • Utility remove nulls from object

    October 19, 2023 · 1 min read

    Just wanted to take note of a cute little util I've been using lately to remove nulls from objects. `javascript export function removeNulls(obj: any): any { const copy = {...obj}; Object.keys....

  • Flyweight Pattern in JavaScript

    September 1, 2021 · 3 min read

    Flyweight pattern is a structural design pattern which are all aimed at altering the composition of objects. Flyweight is usefull when we have a big number of objects with a common part so rather tha...

  • Factory and Singleton Pattern in JavaScript

    August 26, 2021 · 2 min read

    The factory pattern aims to simplify object creation and I've found online an interesting example which requires the repositories and keeps them in a object. The implementation is as follows: `...

  • Constructor Pattern in JavaScript

    August 25, 2021 · 3 min read

    I'm trying to improve my JavaScript know-how so I'm looking into finding out more about commonly used design patterns in JavaScript. The first one I came across is the constructor pattern. Before...