Did you know that if you create a trailing variable led by the spread operator in TypeScript object destructuring that everything you didn't pull out in the other variables ends up in the new, watered-down variable?
Consider:
var hogwash = {
foo: 13,
bar: 42,
baz: 69,
qux: 86
};
const { bar, baz, ...malarkey } = hogwash;
console.log(bar);
console.log(baz);
console.log(malarkey);
No comments:
Post a Comment