16 lines
377 B
JavaScript
16 lines
377 B
JavaScript
function somethingAdvanced({topLeft: {x: x1, y: y1}, bottomRight: {x: x2, y: y2}}){
|
|
|
|
}
|
|
|
|
function unpackObject({title: title, author: author}) {
|
|
return title + ' ' + author;
|
|
}
|
|
|
|
console.log(unpackObject({title: 'title', author: 'author'}));
|
|
|
|
var unpackArray = function ([a, b, c], [x, y, z]) {
|
|
return a+b+c;
|
|
};
|
|
|
|
console.log(unpackArray(['hello', ', ', 'world'], [1, 2, 3]));
|