mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-12-17 08:26:32 +08:00
语法高亮,滚动条美化,设置页面调整
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
<article id="wikiArticle">
|
||||
<div></div>
|
||||
<h2 id="Message">Message</h2>
|
||||
<pre class="syntaxbox">SyntaxError: identifier starts immediately after numeric literal (Firefox)
|
||||
<pre><code class="language-javascript">SyntaxError: identifier starts immediately after numeric literal (Firefox)
|
||||
SyntaxError: Unexpected number (Chrome)
|
||||
</pre>
|
||||
</code></pre>
|
||||
<h2 id="Error_type">Error type</h2>
|
||||
<p><a href="Reference/Global_Objects/SyntaxError" title="SyntaxError 对象代表尝试解析语法上不合法的代码的错误。"><code>SyntaxError</code></a></p>
|
||||
<h2 id="What_went_wrong">What went wrong?</h2>
|
||||
@@ -12,16 +12,16 @@ SyntaxError: Unexpected number (Chrome)
|
||||
<h2 id="Examples">Examples</h2>
|
||||
<h3 id="Variable_names_starting_with_numeric_literals">Variable names starting with numeric literals</h3>
|
||||
<p>Variable names can't start with numbers in JavaScript. The following fails:</p>
|
||||
<pre class="brush: js example-bad">var 1life = 'foo';
|
||||
<pre><code class="language-js example-bad">var 1life = 'foo';
|
||||
// SyntaxError: identifier starts immediately after numeric literal
|
||||
|
||||
var foo = 1life;
|
||||
// SyntaxError: identifier starts immediately after numeric literal
|
||||
</pre>
|
||||
</code></pre>
|
||||
<p>You will need to rename your variable to avoid the leading number.</p>
|
||||
<pre class="brush: js example-good">var life1 = 'foo';
|
||||
<pre><code class="language-js example-good">var life1 = 'foo';
|
||||
var foo = life1;
|
||||
</pre>
|
||||
</code></pre>
|
||||
<h2 id="See_also">See also</h2>
|
||||
<ul>
|
||||
<li><a href="/en-US/docs/Web/JavaScript/Reference/Lexical_grammar">Lexical grammar</a></li>
|
||||
|
||||
Reference in New Issue
Block a user