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

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

@@ -2,17 +2,17 @@
<div></div>
<p>值 <code>null</code> 特指对象的值未设置。它是 JavaScript <a class="glossaryLink" href="/en-US/docs/Glossary/Primitive" title="基本类型: In JavaScript, a primitive (primitive value, primitive data type) is data that is not an object and has no methods. There are 6 primitive data types: string, number, boolean, null, undefined, symbol (new in ECMAScript 2015).">基本类型</a> 之一。</p>
<h2 id="Syntax" name="Syntax" style="margin-bottom: 20px; line-height: 30px;">语法</h2>
<pre class="syntaxbox language-html" style="margin-bottom: 0px; padding: 1em; border-left-width: 6px; border-left-style: solid; font-family: Consolas, Monaco, 'Andale Mono', monospace; font-size: 14px; direction: ltr; white-space: normal; text-shadow: none; background-color: rgba(212, 221, 228, 0.498039);"><code class="language-html" style="font-family: Consolas, Monaco, 'Andale Mono', monospace; direction: ltr; color: inherit; text-shadow: none;">null</code></pre>
<pre><code class="language-html" style="margin-bottom: 0px; padding: 1em; border-left-width: 6px; border-left-style: solid; font-family: Consolas, Monaco, 'Andale Mono', monospace; font-size: 14px; direction: ltr; white-space: normal; text-shadow: none; background-color: rgba(212, 221, 228, 0.498039);"><code class="language-html" style="font-family: Consolas, Monaco, 'Andale Mono', monospace; direction: ltr; color: inherit; text-shadow: none;">null</code></code></pre>
<h2 id="Description" name="Description" style="margin-bottom: 20px; line-height: 30px;">描述</h2>
<p><code>null</code> 是一个字面量,它不像<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined" title="/en-US/docs/JavaScript/Reference/Global_Objects/undefined"><code>undefined</code></a> 是全局对象的一个属性。<code>null</code> 是表示缺少的标识,指示变量未指向任何对象。把 <code>null</code> 作为尚未创建的对象,也许更好理解。在 APIs 中,<code>null</code> 常在返回类型是对象,但没关联值的地方使用。</p>
<pre class="brush: js">// foo不存在它从来没有被定义过或者是初始化过
<pre><code class="language-javascript">// foo不存在它从来没有被定义过或者是初始化过
foo;
"ReferenceError: foo is not defined"
// foo现在已经是知存在的但是它没有类型或者是值
var foo = null;
foo;
null</pre>
null</code></pre>
<div class="line-number" style="margin-top: 1em; position: absolute; left: 0px; right: 0px; line-height: inherit; top: 0px; background: 0px 0px;"> </div>
<div class="line-number" style="margin-top: 1em; position: absolute; left: 0px; right: 0px; line-height: inherit; top: 19px; background: 0px 0px;"> </div>
<div class="line-number" style="margin-top: 1em; position: absolute; left: 0px; right: 0px; line-height: inherit; top: 38px; background: 0px 0px;"> </div>
@@ -22,7 +22,7 @@ null</pre>
<div class="line-number" style="margin-top: 1em; position: absolute; left: 0px; right: 0px; line-height: inherit; top: 114px; background: 0px 0px;"> </div>
<h3 id="null_与_undefined_的不同点" style="line-height: 24px;"><code>null</code> 与 <code>undefined</code> 的不同点:</h3>
<p>当检测 <code>null</code><code>undefined</code> 时,注意<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comparison_Operators">相等(==)与全等(===)两个操作符的区别</a> ,前者会执行类型转换:</p>
<pre class="brush: js">typeof null        // "object" (因为一些以前的原因而不是'null')
<pre><code class="language-javascript">typeof null        // "object" (因为一些以前的原因而不是'null')
typeof undefined   // "undefined"
null === undefined // false
null  == undefined // true
@@ -31,7 +31,7 @@ null == null // true
!null //true
isNaN(1 + null) // false
isNaN(1 + undefined) // true
</pre>
</code></pre>
<div class="line-number" style="margin-top: 1em; position: absolute; left: 0px; right: 0px; line-height: inherit; top: 0px; background: 0px 0px;"> </div>
<div class="line-number" style="margin-top: 1em; position: absolute; left: 0px; right: 0px; line-height: inherit; top: 19px; background: 0px 0px;"> </div>
<div class="line-number" style="margin-top: 1em; position: absolute; left: 0px; right: 0px; line-height: inherit; top: 38px; background: 0px 0px;"> </div>