语法高亮,滚动条美化,设置页面调整

This commit is contained in:
fofolee
2019-04-19 02:41:09 +08:00
parent 1e8f76c000
commit 359d29ee0b
1590 changed files with 12328 additions and 11441 deletions

View File

@@ -4,7 +4,7 @@
<div><iframe class="interactive interactive-js" frameborder="0" height="250" src="https://interactive-examples.mdn.mozilla.net/pages/js/statement-const.html" width="100%"></iframe></div>
<p class="hidden">The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone <a class="external" href="https://github.com/mdn/interactive-examples" rel="noopener">https://github.com/mdn/interactive-examples</a> and send us a pull request.</p>
<h2 id="语法">语法</h2>
<pre class="syntaxbox">const <em>name1 = <em>value1 [</em>, <em>name2</em> = <em>value2</em><em> [</em>, ... [</em>, <em>nameN</em> = <em>valueN]]]</em>;</pre>
<pre><code class="language-javascript">const <em>name1 = <em>value1 [</em>, <em>name2</em> = <em>value2</em><em> [</em>, ... [</em>, <em>nameN</em> = <em>valueN]]]</em>;</code></pre>
<dl>
<dt><code>nameN</code></dt>
<dd>常量名称,可以是任意合法的<a class="glossaryLink" href="/en-US/docs/Glossary/identifier" title="标识符: A sequence of characters in the code that identifies a variable, function, or property.">标识符</a></dd>
@@ -18,7 +18,7 @@
<p>一个常量不能和它所在作用域内的其他变量或函数拥有相同的名称。</p>
<h2 id="示例">示例</h2>
<p>下面的例子演示了常量的特性。在浏览器的控制台试一下这个例子。</p>
<pre class="brush:js line-numbers language-js"><code class="language-js"><span class="comment token">// 注意: 常量在声明的时候可以使用大小写,但通常情况下全部用大写字母。 </span>
<pre><code class="language-js line-numbers language-js"><code class="language-js"><span class="comment token">// 注意: 常量在声明的时候可以使用大小写,但通常情况下全部用大写字母。 </span>
<span class="comment token">// 定义常量MY_FAV并赋值7</span>
<span class="keyword token">const</span> MY_FAV <span class="operator token">=</span> <span class="number token">7</span><span class="punctuation token">;</span>
@@ -72,7 +72,7 @@ const MY_ARRAY = [];
// 可以向数组填充数据
MY_ARRAY.push('A'); // ["A"]
// 但是,将一个新数组赋给变量会引发错误
MY_ARRAY = ['B']</code></pre>
MY_ARRAY = ['B']</code></code></pre>
<h2 id="规范">规范</h2>
<table class="standard-table">
<tbody>