3 ms·
Whether to pass in a single dict/object/map/assoc-list or individually separated arguments is a tale as old as LISP (JS has some FP roots if you squint hard eno
by valbaca 4y ago
Whether to pass in a single dict/object/map/assoc-list or individually separated arguments is a tale as old as LISP (JS has some FP roots if you squint hard enough) and most LISPs (and JS has started doing this as well) mitigates this with destructuring:
Common Lisp: https://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node252.html https://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node252.html
Clojure: http://blog.jayfields.com/2010/07/clojure-destructuring.html http://blog.jayfields.com/2010/07/clojure-destructuring.html
JS: https://simonsmith.io/destructuring-objects-as-function-parameters-in-es6 https://simonsmith.io/destructuring-objects-as-function-para...