diff options
| author | Irvin <irvinfly@gmail.com> | 2022-02-16 02:02:49 +0800 |
|---|---|---|
| committer | Irvin <irvinfly@gmail.com> | 2022-02-16 02:35:54 +0800 |
| commit | 01b0e12ba27b5069248fd09235e9a7143915ee30 (patch) | |
| tree | 0e9edf538dc3fa3331e1dbb79239b58186765f86 /files/zh-cn/web/javascript/reference/global_objects/object/create/index.html | |
| parent | 6ca84f1794af830ada9736d7289ce29aabb04ca3 (diff) | |
| download | translated-content-01b0e12ba27b5069248fd09235e9a7143915ee30.tar.gz translated-content-01b0e12ba27b5069248fd09235e9a7143915ee30.tar.bz2 translated-content-01b0e12ba27b5069248fd09235e9a7143915ee30.zip | |
remove `notranslate` class in zh-CN
Diffstat (limited to 'files/zh-cn/web/javascript/reference/global_objects/object/create/index.html')
| -rw-r--r-- | files/zh-cn/web/javascript/reference/global_objects/object/create/index.html | 10 |
1 files changed, 5 insertions, 5 deletions
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 073605d77f..671c542a48 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 @@ -20,7 +20,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Object/create <h2 id="Syntax" name="Syntax">语法</h2> -<pre class="notranslate">Object.create(<var>proto,[</var><var>propertiesObject</var>])</pre> +<pre>Object.create(<var>proto,[</var><var>propertiesObject</var>])</pre> <h3 id="Parameters" name="Parameters">参数</h3> @@ -45,7 +45,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Object/create <p>下面的例子演示了如何使用<code>Object.create()</code>来实现类式继承。这是一个所有版本JavaScript都支持的单继承。</p> -<pre class="brush: js notranslate">// Shape - 父类(superclass) +<pre class="brush: js">// Shape - 父类(superclass) function Shape() { this.x = 0; this.y = 0; @@ -77,7 +77,7 @@ rect.move(1, 1); // Outputs, 'Shape moved.'</pre> <p>如果你希望能继承到多个对象,则可以使用混入的方式。</p> -<pre class="brush: js notranslate">function MyClass() { +<pre class="brush: js">function MyClass() { SuperClass.call(this); OtherSuperClass.call(this); } @@ -98,7 +98,7 @@ MyClass.prototype.myMethod = function() { <h3 id="使用_Object.create_的_propertyObject参数">使用 <code>Object.create</code> 的 <code>propertyObject</code>参数</h3> -<pre class="brush: js notranslate">var o; +<pre class="brush: js">var o; // 创建一个原型为null的空对象 o = Object.create(null); @@ -167,7 +167,7 @@ o2 = Object.create({}, { <p>请注意,尽管在 ES5 中 <code>Object.create</code>支持设置为<code>[[Prototype]]</code>为<code>null</code>,但因为那些ECMAScript5以前版本限制,此 polyfill 无法支持该特性。</p> -<pre class="brush: js notranslate">if (typeof Object.create !== "function") { +<pre class="brush: js">if (typeof Object.create !== "function") { Object.create = function (proto, propertiesObject) { if (typeof proto !== 'object' && typeof proto !== 'function') { throw new TypeError('Object prototype may only be an Object: ' + proto); |
