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

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,10 +2,10 @@
<div></div>
<p>The <strong><code>Int32Array</code></strong> typed array represents an array of twos-complement 32-bit signed integers in the platform byte order. If control over byte order is needed, use <a href="Reference/Global_Objects/DataView" title="DataView 视图是一个可以从 ArrayBuffer 对象中读写多种数值类型的底层接口,在读写时不用考虑平台字节序问题。"><code>DataView</code></a> instead. The contents are initialized to <code>0</code>. Once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).</p>
<h2 id="语法">语法</h2>
<pre class="syntaxbox">new Int32Array(length);
<pre><code class="language-javascript">new Int32Array(length);
new Int32Array(typedArray);
new Int32Array(object);
new Int32Array(buffer [, byteOffset [, length]]);</pre>
new Int32Array(buffer [, byteOffset [, length]]);</code></pre>
<p>For more information about the constructor syntax and the parameters, see <em><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#Syntax">TypedArray</a></em>.</p>
<h2 id="属性">属性</h2>
<dl>
@@ -98,7 +98,7 @@ new Int32Array(buffer [, byteOffset [, length]]);</pre>
<dd>Returns a new <code>Array Iterator</code> object that contains the values for each index in the array.</dd>
</dl>
<h2 id="例子">例子</h2>
<pre class="brush: js">// From a length
<pre><code class="language-javascript">// From a length
var int32 = new Int32Array(2);
int32[0] = 42;
console.log(int32[0]); // 42
@@ -117,7 +117,7 @@ console.log(y[0]); // 21
// From an ArrayBuffer
var buffer = new ArrayBuffer(16);
var z = new Int32Array(buffer, 0, 4);
</pre>
</code></pre>
<h2 id="详细描述">详细描述</h2>
<table class="standard-table">
<tbody>
@@ -220,10 +220,10 @@ var z = new Int32Array(buffer, 0, 4);
</div>
<h2 id="兼容性说明">兼容性说明</h2>
<p>Starting with ECMAScript 2015 (ES6), <code>In32Array</code> constructors require to be constructed with a <a href="Reference/Operators/new" title="new 运算符创建一个用户定义的对象类型的实例或具有构造函数的内置对象的实例。"><code>new</code></a> operator. Calling a <code>Int32Array</code> constructor as a function without <code>new</code>, will throw a <a href="Reference/Global_Objects/TypeError" title="TypeError类型错误 对象用来表示值的类型非预期类型时发生的错误。"><code>TypeError</code></a> from now on.</p>
<pre class="brush: js example-bad">var dv = Int32Array([1, 2, 3]);
<pre><code class="language-js example-bad">var dv = Int32Array([1, 2, 3]);
// TypeError: calling a builtin Int32Array constructor
// without new is forbidden</pre>
<pre class="brush: js example-good">var dv = new Int32Array([1, 2, 3]);</pre>
// without new is forbidden</code></pre>
<pre><code class="language-js example-good">var dv = new Int32Array([1, 2, 3]);</code></pre>
<h2 id="参见">参见</h2>
<ul>
<li><a href="/en-US/docs/Web/JavaScript/Typed_arrays" title="en/JavaScript typed arrays">JavaScript typed arrays</a></li>