JavaScript/解构:修订间差异

来自康健生活
Kangkk​(留言 | 贡献)
Kangkk​(留言 | 贡献)
第11行: 第11行:
1</pre>}}}}
1</pre>}}}}
{{leftrightflex|<syntaxhighlight lang="javascript">
{{leftrightflex|<syntaxhighlight lang="javascript">
const [firstColor = 'white'] = colors;</syntaxhighlight>|{{consoleout|<pre>
const colors = [];
const [firstColor = 'white'] = colors;
const [, secondColor = 'black'] = colors;</syntaxhighlight>|{{consoleout|<pre>
white
white
black
</pre>}}}}
</pre>}}}}
{{unknown}}