mirror of
https://github.com/swc-project/swc.git
synced 2024-12-26 23:27:56 +03:00
6 lines
160 B
JavaScript
6 lines
160 B
JavaScript
|
function foo(boo, key) {
|
||
|
const value = boo.get();
|
||
|
return value.map(({ [key]: bar }) => bar);
|
||
|
}
|
||
|
console.log(foo({ get: () => [{ blah: 42 }] }, "blah"));
|