JavaScript/解构:修订间差异
来自康健生活
| 第11行: | 第11行: | ||
1</pre>}}}} | 1</pre>}}}} | ||
{{leftrightflex|<syntaxhighlight lang="javascript"> | {{leftrightflex|<syntaxhighlight lang="javascript"> | ||
const [firstColor = 'white'] = []; | |||
const [firstColor = 'white'] = | const [, secondColor = 'black'] = [];</syntaxhighlight>|{{consoleout|<pre> | ||
const [, secondColor = 'black'] = | |||
white | white | ||
black | black | ||
</pre>}}}} | </pre>}}}} | ||
{{unknown}} | {{unknown}} | ||
{{leftrightflex|<syntaxhighlight lang="javascript"> | |||
const [, ...numbers] = [1, 2, 3];</syntaxhighlight>|{{consoleout|<pre> | |||
(2) [2, 3] | |||
</pre>}}}} | |||
2020年6月24日 (三) 16:23的版本
No categories