diff options
author | Irvin <irvinfly@gmail.com> | 2022-02-16 02:03:27 +0800 |
---|---|---|
committer | Irvin <irvinfly@gmail.com> | 2022-02-16 02:35:54 +0800 |
commit | 012ee621791b6895e637f96e6523027951768f25 (patch) | |
tree | 29cfacc0d5092af45870dcc74f22feb8b2664fbf /files/zh-cn/web/javascript/reference/global_objects/object | |
parent | ba91b017421b001cd226135612a7bd5dfcd88904 (diff) | |
download | translated-content-012ee621791b6895e637f96e6523027951768f25.tar.gz translated-content-012ee621791b6895e637f96e6523027951768f25.tar.bz2 translated-content-012ee621791b6895e637f96e6523027951768f25.zip |
remove inline style for zh-CN
Diffstat (limited to 'files/zh-cn/web/javascript/reference/global_objects/object')
15 files changed, 28 insertions, 44 deletions
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/constructor/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/constructor/index.html index b56ef4c920..ac1375763a 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/object/constructor/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/object/constructor/index.html @@ -196,7 +196,7 @@ Child.prototype.getOffsetByInitialPosition = function getOffsetByInitialPosition <p><strong>总结</strong>:手动设置或更新构造函数可能会导致不同且有时令人困惑的后果。为了防止它,只需在每个特定情况下定义构造函数的角色。在大多数情况下,不使用构造函数,并且不需要重新分配构造函数。</p> -<h2 id="规范" style="margin-bottom: 20px; line-height: 30px;">规范</h2> +<h2 id="规范">规范</h2> <table class="standard-table"> <tbody> diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/create/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/create/index.html index 255cd9ec0c..9bd6e7589c 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/object/create/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/object/create/index.html @@ -159,7 +159,7 @@ o2 = Object.create({}, { } });</pre> -<h2 id="Polyfill" style="line-height: 24px;">Polyfill</h2> +<h2 id="Polyfill">Polyfill</h2> <p>这个 polyfill 涵盖了主要的应用场景,它创建一个已经选择了原型的新对象,但没有把第二个参数考虑在内。</p> @@ -182,7 +182,7 @@ o2 = Object.create({}, { }; }</pre> -<h2 id="规范" style="margin-bottom: 20px; line-height: 30px;">规范</h2> +<h2 id="规范">规范</h2> <table class="standard-table"> <tbody> @@ -213,11 +213,11 @@ o2 = Object.create({}, { <p>{{Compat("javascript.builtins.Object.create")}}</p> -<h2 id="See_also" name="See_also" style="margin-bottom: 20px; line-height: 30px;">相关链接</h2> +<h2 id="See_also" name="See_also">相关链接</h2> <ul> <li>{{jsxref("Object.defineProperty")}}</li> <li>{{jsxref("Object.defineProperties")}}</li> <li>{{jsxref("Object.prototype.isPrototypeOf")}}</li> - <li>John Resig's post on <a class="external external-icon" href="http://ejohn.org/blog/objectgetprototypeof/" style="white-space: pre-line;" title="http://ejohn.org/blog/objectgetprototypeof/">getPrototypeOf</a></li> + <li>John Resig's post on <a class="external external-icon" href="http://ejohn.org/blog/objectgetprototypeof/" title="http://ejohn.org/blog/objectgetprototypeof/">getPrototypeOf</a></li> </ul> diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/defineproperties/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/defineproperties/index.html index e4d9e9ef7a..9758d0af9b 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/object/defineproperties/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/object/defineproperties/index.html @@ -141,7 +141,7 @@ Object.defineProperties(obj, { return obj; }</pre> -<h2 id="规范" style="margin-bottom: 20px; line-height: 30px;">规范</h2> +<h2 id="规范">规范</h2> <table class="standard-table"> <tbody> diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/defineproperty/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/defineproperty/index.html index b37662d5ab..74b6088e27 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/object/defineproperty/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/object/defineproperty/index.html @@ -172,7 +172,7 @@ Object.defineProperty(obj, "key", withValue("static")); <h2 id="示例">示例</h2> -<p>如果你想了解如何使用 <code>Object.defineProperty</code> 方法和<em>类二进制标记</em>语法,可以看看这些<a href="/en-US/docs/JavaScript/Reference/Global_Objects/Object/defineProperty/Additional_examples" style="line-height: 1.5;">额外示例</a>。</p> +<p>如果你想了解如何使用 <code>Object.defineProperty</code> 方法和<em>类二进制标记</em>语法,可以看看这些<a href="/en-US/docs/JavaScript/Reference/Global_Objects/Object/defineProperty/Additional_examples">额外示例</a>。</p> <h3 id="创建属性">创建属性</h3> diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/freeze/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/freeze/index.html index 947a54007d..bd48ad319b 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/object/freeze/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/object/freeze/index.html @@ -161,7 +161,7 @@ TypeError: 1 is not an object // ES5 code <p>用<code>Object.seal()</code>密封的对象可以改变它们现有的属性。使用<code>Object.freeze()</code> 冻结的对象中现有属性是不可变的。</p> -<h2 id="规范" style="margin-bottom: 20px; line-height: 30px;">规范</h2> +<h2 id="规范">规范</h2> <table class="standard-table"> <tbody> diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/getownpropertydescriptor/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/getownpropertydescriptor/index.html index 7738e33117..b8432c64bd 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/object/getownpropertydescriptor/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/object/getownpropertydescriptor/index.html @@ -27,7 +27,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDes <dd>目标对象内属性名称</dd> </dl> -<h3 id="返回值" style="line-height: 24px;">返回值</h3> +<h3 id="返回值">返回值</h3> <p>如果指定的属性存在于对象上,则返回其属性描述符对象(property descriptor),否则返回 {{jsxref("undefined")}}。</p> @@ -103,7 +103,7 @@ Object.getOwnPropertyDescriptor('foo', 0); // writable: false // }</pre> -<h2 id="规范" style="margin-bottom: 20px; line-height: 30px;">规范</h2> +<h2 id="规范">规范</h2> <table class="standard-table"> <tbody> @@ -139,7 +139,7 @@ Object.getOwnPropertyDescriptor('foo', 0); <div></div> -<div><strong style="">相关链接</strong> </div> +<div><strong>相关链接</strong> </div> <ul> <li>{{jsxref("Object.defineProperty()")}}</li> diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/getownpropertynames/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/getownpropertynames/index.html index b4ad24a572..3f86e43049 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/object/getownpropertynames/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/object/getownpropertynames/index.html @@ -29,7 +29,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyNam <p>在给定对象上找到的自身属性对应的字符串数组。</p> -<h2 id="Description" name="Description" style="margin-bottom: 20px; line-height: 30px;">描述</h2> +<h2 id="Description" name="Description">描述</h2> <p><code>Object.getOwnPropertyNames()</code> 返回一个数组,该数组对元素是 <code>obj</code>自身拥有的枚举或不可枚举属性名称字符串。 数组中枚举属性的顺序与通过 {{jsxref("Statements/for...in", "for...in")}} 循环(或 {{jsxref("Object.keys")}})迭代该对象属性时一致。数组中不可枚举属性的顺序未定义。</p> @@ -155,7 +155,7 @@ Object.getOwnPropertyNames('foo'); <p>Firefox 28 {{geckoRelease("28")}}之前,<code>Object.getOwnPropertyNames</code> 不会获取到 {{jsxref("Error")}} 对象的属性。该 bug 在后面的版本修复了 ({{bug("724768")}})。</p> -<h2 id="See_also" name="See_also" style="margin-bottom: 20px; line-height: 30px;">相关链接</h2> +<h2 id="See_also" name="See_also">相关链接</h2> <ul> <li><a href="https://developer.mozilla.org/en-US/docs/Enumerability_and_ownership_of_properties" title="Enumerability_and_ownership_of_properties">Enumerability and ownership of properties</a></li> diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/getprototypeof/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/getprototypeof/index.html index df45e04217..2d8e4928f8 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/object/getprototypeof/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/object/getprototypeof/index.html @@ -65,30 +65,16 @@ Object.prototype === Object.getPrototypeOf( obj ); // true Object.prototype === Object.getPrototypeOf( {} ); // true</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> - <h2 id="Notes" name="Notes">Notes</h2> -<p>在 ES5 中,如果参数不是一个对象类型,将抛出一个{{jsxref("TypeError")}}异常。在 ES2015 中,参数会被强制转换为一个 {{jsxref("Object")}}<strong style="font-weight: bold;">。</strong></p> +<p>在 ES5 中,如果参数不是一个对象类型,将抛出一个{{jsxref("TypeError")}}异常。在 ES2015 中,参数会被强制转换为一个 {{jsxref("Object")}}<strong>。</strong></p> <pre class="brush: js">Object.getPrototypeOf('foo'); // TypeError: "foo" is not an object (ES5 code) Object.getPrototypeOf('foo'); // String.prototype (ES2015 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> - -<div class="line-number" style="margin-top: 1em; position: absolute; left: 0px; right: 0px; line-height: inherit; top: 57px; background: 0px 0px;"> </div> - -<h2 id="规范" style="margin-bottom: 20px; line-height: 30px;">规范</h2> +<h2 id="规范">规范</h2> <table class="standard-table"> <tbody> @@ -129,7 +115,7 @@ Object.getPrototypeOf('foo'); <li>{{jsxref("Object.prototype.isPrototypeOf")}}</li> <li>{{jsxref("Object.setPrototypeOf()")}}</li> <li>{{jsxref("Object.prototype.__proto__")}}</li> - <li>John Resig's post on <a class="external external-icon" href="http://ejohn.org/blog/objectgetprototypeof/" style="white-space: pre-line;" title="http://ejohn.org/blog/objectgetprototypeof/">getPrototypeOf</a></li> + <li>John Resig's post on <a class="external external-icon" href="http://ejohn.org/blog/objectgetprototypeof/" title="http://ejohn.org/blog/objectgetprototypeof/">getPrototypeOf</a></li> <li>{{jsxref("Reflect.getPrototypeOf()")}}</li> <li>{{jsxref("AsyncFunction")}}</li> </ul> diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/isextensible/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/isextensible/index.html index 249ce52673..817dd1296a 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/object/isextensible/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/object/isextensible/index.html @@ -49,7 +49,7 @@ Object.isExtensible(frozen); // === false <p> </p> -<h2 id="注意" style="margin-bottom: 20px; line-height: 30px;">注意</h2> +<h2 id="注意">注意</h2> <p>在 ES5 中,如果参数不是一个对象类型,将抛出一个 {{jsxref("TypeError")}} 异常。在 ES6 中, non-object 参数将被视为一个不可扩展的普通对象,因此会返回 false 。</p> @@ -60,7 +60,7 @@ Object.isExtensible(1); // false (ES6 code) </pre> -<h2 id="规范" style="margin-bottom: 20px; line-height: 30px;">规范</h2> +<h2 id="规范">规范</h2> <table class="standard-table"> <tbody> @@ -133,7 +133,7 @@ Object.isExtensible(1); </table> </div> -<h2 id="See_also" name="See_also" style="margin-bottom: 20px; line-height: 30px;">相关链接</h2> +<h2 id="See_also" name="See_also">相关链接</h2> <ul> <li><strong>{{jsxref("Object.preventExtensions")}}</strong></li> diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/isfrozen/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/isfrozen/index.html index c923cc5530..9a730a6d2c 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/object/isfrozen/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/object/isfrozen/index.html @@ -108,7 +108,7 @@ Object.isFrozen(1); // true (ES2015 code) </pre> -<h2 id="规范" style="margin-bottom: 20px; line-height: 30px;">规范</h2> +<h2 id="规范">规范</h2> <table class="standard-table"> <tbody> diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/issealed/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/issealed/index.html index e6a895f345..2a70e41e8e 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/object/issealed/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/object/issealed/index.html @@ -68,7 +68,7 @@ Object.isFrozen(s2); // === false, 属性"p"可写 var s3 = Object.seal({ get p() { return 0; } }); Object.isFrozen(s3); // === true ,访问器属性不考虑可写不可写,只考虑是否可配置</pre> -<h2 id="注意" style="margin-bottom: 20px; line-height: 30px;">注意</h2> +<h2 id="注意">注意</h2> <p>在ES5中,如果这个方法的参数不是一个对象(一个原始类型),那么它会导致{{jsxref("TypeError")}}。在ES2015中,非对象参数将被视为是一个密封的普通对象,只返回<code>true</code>。</p> @@ -78,7 +78,7 @@ Object.isFrozen(s3); // === true ,访问器属性不考虑可写不可写,只 Object.isSealed(1); // true (ES2015 code)</pre> -<h2 id="规范" style="margin-bottom: 20px; line-height: 30px;">规范</h2> +<h2 id="规范">规范</h2> <table class="standard-table"> <tbody> diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/keys/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/keys/index.html index b477b88320..3a778356b0 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/object/keys/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/object/keys/index.html @@ -28,7 +28,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Object/keys <p>一个表示给定对象的所有可枚举属性的字符串数组。</p> -<h2 id="Description" name="Description" style="margin-bottom: 20px; line-height: 30px;">描述</h2> +<h2 id="Description" name="Description">描述</h2> <p><code>Object.keys</code> 返回一个所有元素为字符串的数组,其元素来自于从给定的<code>object</code>上面可直接枚举的属性。这些属性的顺序与手动遍历该对象属性时的一致。</p> @@ -110,7 +110,7 @@ Object.keys("foo"); <p>另一个简单的实现,参见<a class="external" href="http://tokenposts.blogspot.com.au/2012/04/javascript-objectkeys-browser.html">Javascript - Object.keys Browser Compatibility</a>。</p> -<h2 id="规范" style="margin-bottom: 20px; line-height: 30px;">规范</h2> +<h2 id="规范">规范</h2> <table class="standard-table"> <tbody> diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/preventextensions/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/preventextensions/index.html index 9658716cff..f412762462 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/object/preventextensions/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/object/preventextensions/index.html @@ -86,7 +86,7 @@ fixed.__proto__ = { oh: 'hai' };</pre> Object.preventExtensions(1); // 1 (ES2015 code)</pre> -<h2 id="规范" style="margin-bottom: 20px; line-height: 30px;">规范</h2> +<h2 id="规范">规范</h2> <table class="standard-table"> <tbody> diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/seal/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/seal/index.html index 6fd23f3d1d..69d14321ee 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/object/seal/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/object/seal/index.html @@ -105,7 +105,7 @@ Object.seal(1); <p>使用<code>Object.freeze()</code>冻结的对象中的现有属性值是不可变的。用<code>Object.seal()</code>密封的对象可以改变其现有属性值。</p> -<h2 id="规范" style="margin-bottom: 20px; line-height: 30px;">规范</h2> +<h2 id="规范">规范</h2> <table class="standard-table"> <tbody> diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/valueof/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/valueof/index.html index c9f98bebc4..e2627097bd 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/object/valueof/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/object/valueof/index.html @@ -7,7 +7,7 @@ tags: - Object translation_of: Web/JavaScript/Reference/Global_Objects/Object/valueOf --- -<div style="margin: 0px; padding: 0px; border: 0px; color: rgb(77, 78, 83); font-family: 'Open Sans', sans-serif; font-size: 14px; line-height: 21px; background-color: rgb(255, 255, 255);">{{JSRef}}</div> +<div>{{JSRef}}</div> <p><code><strong>valueOf()</strong></code> 方法返回指定对象的原始值。</p> @@ -81,8 +81,6 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Object/valueOf <pre class="brush: js">MyNumberType.prototype.valueOf = function() { return customPrimitiveValue; };</pre> -<div class="line-number" style="margin: 1em 0px 0px; border: 0px; position: absolute; left: 0px; right: 0px; line-height: inherit; top: 0px; background: 0px 0px;"> </div> - <p>有了这样的一个方法,下一次每当<code>MyNumberType</code>要被转换为原始类型值时,JavaScript 在此之前会自动调用自定义的<code>valueOf</code>方法。</p> <p><code>valueOf</code>方法一般都会被 JavaScript 自动调用,但你也可以像下面代码那样自己调用:</p> @@ -90,7 +88,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Object/valueOf <pre class="brush: js">myNumberType.valueOf()</pre> <div class="note"> -<p dir="ltr"><strong style="border: 0px; margin: 0px; padding: 0px;">注意:</strong>字符串上下文中的对象通过 {{jsxref("Object.toString", "toString()")}}方法转换,这与使用<code>valueOf</code>转换为原始字符串的{{jsxref("String")}}对象不同。所有对象都能转换成一个“<code>[object <em>类型</em>]</code>”这种格式的字符串。但是很多对象不能转换为数字,布尔或函数。</p> +<p dir="ltr"><strong>注意:</strong>字符串上下文中的对象通过 {{jsxref("Object.toString", "toString()")}}方法转换,这与使用<code>valueOf</code>转换为原始字符串的{{jsxref("String")}}对象不同。所有对象都能转换成一个“<code>[object <em>类型</em>]</code>”这种格式的字符串。但是很多对象不能转换为数字,布尔或函数。</p> </div> <h2 id="示例">示例</h2> |