mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2026-02-28 01:58:28 +08:00
语法高亮,滚动条美化,设置页面调整
This commit is contained in:
@@ -4,12 +4,12 @@
|
||||
<div><iframe class="interactive interactive-js" frameborder="0" height="250" src="https://interactive-examples.mdn.mozilla.net/pages/js/dataview-bytelength.html" width="100%"></iframe></div>
|
||||
<p class="hidden">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 <a class="external" href="https://github.com/mdn/interactive-examples" rel="noopener">https://github.com/mdn/interactive-examples</a> and send us a pull request.</p>
|
||||
<h2 id="语法">语法</h2>
|
||||
<pre class="syntaxbox"><var>dataview</var>.byteLength</pre>
|
||||
<pre><code class="language-javascript"><var>dataview</var>.byteLength</code></pre>
|
||||
<h2 id="描述">描述</h2>
|
||||
<p><code>byteLength</code> 属性是一个获取(accessor)属性,它的 set 属性为 undefined,这意味着它是只读的。值在 <code>DataView 被创建时就确定了,且不能改变。如果</code> <code>DataView</code> 没有指定偏移量或byteLength,那么被引用的 <code>ArrayBuffer 的字节长度将被返回。</code></p>
|
||||
<h2 id="Examples">Examples</h2>
|
||||
<h3 id="Using_the_byteLength_property">Using the <code>byteLength</code> property</h3>
|
||||
<pre class="brush:js">var buffer = new ArrayBuffer(8);
|
||||
<pre><code class="language-js">var buffer = new ArrayBuffer(8);
|
||||
var dataview = new DataView(buffer);
|
||||
dataview.byteLength; // 8 (matches the byteLength of the buffer)
|
||||
|
||||
@@ -18,7 +18,7 @@ dataview2.byteLength; // 5 (as specified when constructing the DataView)
|
||||
|
||||
var dataview3 = new DataView(buffer, 2);
|
||||
dataview3.byteLength; // 6 (due to the offset of the constructed DataView)
|
||||
</pre>
|
||||
</code></pre>
|
||||
<h2 id="规范">规范</h2>
|
||||
<table class="standard-table">
|
||||
<tbody>
|
||||
|
||||
Reference in New Issue
Block a user