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

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

@@ -3,7 +3,7 @@
<h2 id="Summary" name="Summary">概述</h2>
<p><code><strong>Object.isExtensible()</strong></code> 方法判断一个对象是否是可扩展的(是否可以在它上面添加新的属性)。</p>
<h2 id="Syntax" name="Syntax">语法</h2>
<pre class="syntaxbox"><code>Object.isExtensible(<em>obj</em>)</code></pre>
<pre><code class="language-javascript"><code>Object.isExtensible(<em>obj</em>)</code></code></pre>
<h3 id="Parameters" name="Parameters">参数</h3>
<dl>
<dt>obj</dt>
@@ -14,7 +14,7 @@
<h2 id="Description" name="Description">描述</h2>
<p>默认情况下,对象是可扩展的:即可以为他们添加新的属性。以及它们的 <a href="Reference/Global_Objects/Object/proto" title="使用__proto__是有争议的也不鼓励使用它。因为它从来没有被包括在EcmaScript语言规范中但是现代浏览器都实现了它。__proto__属性已在ECMAScript 6语言规范中标准化用于确保Web浏览器的兼容性因此它未来将被支持。它已被不推荐使用, 现在更推荐使用Object.getPrototypeOf/Reflect.getPrototypeOf 和Object.setPrototypeOf/Reflect.setPrototypeOf尽管如此设置对象的[[Prototype]]是一个缓慢的操作,如果性能是一个问题,应该避免)。"><code>__proto__</code></a><span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span> 属性可以被更改。<a href="Reference/Global_Objects/Object/preventExtensions" title="Object.preventExtensions()方法让一个对象变的不可扩展,也就是永远不能再添加新的属性。"><code>Object.preventExtensions</code></a><a href="Reference/Global_Objects/Object/seal" title="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 https://github.com/mdn/interactive-examples and send us a pull request."><code>Object.seal</code></a><a href="Reference/Global_Objects/Object/freeze" title="Object.freeze() 方法可以冻结一个对象。一个被冻结的对象再也不能被修改冻结了一个对象则不能向这个对象添加新的属性不能删除已有属性不能修改该对象已有属性的可枚举性、可配置性、可写性以及不能修改已有属性的值。此外冻结一个对象后该对象的原型也不能被修改。freeze() 返回和传入的参数相同的对象。"><code>Object.freeze</code></a> 方法都可以标记一个对象为不可扩展non-extensible</p>
<h2 id="Examples" name="Examples">例子</h2>
<pre class="brush: js">// 新对象默认是可扩展的.
<pre><code class="language-javascript">// 新对象默认是可扩展的.
var empty = {};
Object.isExtensible(empty); // === true
@@ -29,7 +29,7 @@ Object.isExtensible(sealed); // === false
// 冻结对象也是不可扩展.
var frozen = Object.freeze({});
Object.isExtensible(frozen); // === false
</pre>
</code></pre>
<p> </p>
<h2 id="注意" style="margin-bottom: 20px; line-height: 30px;">注意</h2>
<p>在 ES5 中,如果参数不是一个对象类型,将抛出一个 <a href="Reference/Global_Objects/TypeError" title="TypeError类型错误 对象用来表示值的类型非预期类型时发生的错误。"><code>TypeError</code></a> 异常。在 ES6 中, non-object 参数将被视为一个不可扩展的普通对象,因此会返回 false 。</p>
@@ -38,7 +38,7 @@ Object.isExtensible(frozen); // === false
Object.isExtensible(1);
// false (ES6 code)
</pre>
</code></pre>
<h2 id="规范" style="margin-bottom: 20px; line-height: 30px;">规范</h2>
<table class="standard-table">
<tbody>