home.social

#parameterobject — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #parameterobject, aggregated by home.social.

  1. Assign properties in a constructor’s parameter object (with defaults) to object being instantiated in JavaScript

    codeberg.org/aral/gists/src/br

    This is a little something I ended up playing around with this morning before figuring out how to do it (after spending far too much time down a rabbit hole with object destructuring when what I really needed was creative use of the spread operator).

    (Useful for custom objects in JSDB 5 – codeberg.org/small-tech/jsdb#c)

    #JavaScript #parameterObject #defaults #JSDB