数组对象解构赋值
对象
1 | let node = { |
1 | let node = { |
1 | let node = { |
数组
1 | let colors = ['red', 'green', 'blue']; |
1 | let colors = ['red']; |
1 | let colors = ['red', 'green', 'blue']; |
应用场景
函数解构
1 | function setCookie(name, value, { path, domain, expire }) { |
1 | function setCookie(name, value, { path, domain, expire } = {}) { |