Remix.run Logo
MathMonkeyMan 4 hours ago

You can do this as a convention in javascript since 2015, but I haven't seen a library that does it:

    > function foo({a, b, c}) {
    ... return {x: a, y: b, z: c};
    ... }
    undefined
    > foo({a: 1, b: 2, c: 3})
    { x: 1, y: 2, z: 3 }
    > const a = 'A', b = 'B', c = 'C';
    undefined
    > foo({a, b, c})
    { x: 'A', y: 'B', z: 'C' }
    >