JavaScript/解构:修订间差异
来自康健生活
| 第20行: | 第20行: | ||
const [, ...numbers] = [1, 2, 3];</syntaxhighlight>|{{consoleout|<pre> | const [, ...numbers] = [1, 2, 3];</syntaxhighlight>|{{consoleout|<pre> | ||
(2) [2, 3] | (2) [2, 3] | ||
</pre>}}}} | |||
{{leftrightflex|<syntaxhighlight lang="javascript"> | |||
const { foo, ...small } = { | |||
foo: 'value Foo', | |||
bar: 'value Bar' | |||
};</syntaxhighlight>|{{consoleout|<pre> | |||
"value Foo" | |||
{bar: "value Bar"} | |||
</pre>}}}} | </pre>}}}} | ||
2020年6月24日 (三) 16:25的版本
No categories