Does JavaScript destructuring have syntax to capture both an object and its content?
In other words, can I do the following completely in the function's arg list without the following const
line?
f = (a) => {
const {b} = a;
console.log("I see:", a, "and", b);
}
f({b:42})
==> I see {b: 42} and 42
(FWIW: I'm thinking of something like :as
in Clojure or ClojureScript).