packages/babel-plugin-transform-destructuring/test/fixtures/destructuring/parameters/input.js
raw| 1 | function somethingAdvanced({topLeft: {x: x1, y: y1} = {}, bottomRight: {x: x2, y: y2} = {}}, p2, p3){ |
| 2 | |
| 3 | } |
| 4 | |
| 5 | function unpackObject({title: title, author: author}) { |
| 6 | return title + " " + author; |
| 7 | } |
| 8 | |
| 9 | console.log(unpackObject({title: "title", author: "author"})); |
| 10 | |
| 11 | var unpackArray = function ([a, b, c], [x, y, z]) { |
| 12 | return a+b+c; |
| 13 | }; |
| 14 | |
| 15 | console.log(unpackArray(["hello", ", ", "world"], [1, 2, 3])); |