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

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

@@ -6,8 +6,8 @@
<div><iframe class="interactive interactive-js" frameborder="0" height="250" src="https://interactive-examples.mdn.mozilla.net/pages/js/atomics-compareexchange.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">Atomics.compareExchange(typedArray, index, expectedValue, replacementValue)
</pre>
<pre><code class="language-javascript">Atomics.compareExchange(typedArray, index, expectedValue, replacementValue)
</code></pre>
<h3 id="参数">参数</h3>
<dl>
<dt><code>typedArray</code></dt>
@@ -28,12 +28,12 @@
<li>如果 <code>index</code> 超出了 <code>typedArray 的边界,则抛出</code> <a href="Reference/Global_Objects/RangeError" title="RangeError对象标明一个错误当一个值不在其所允许的范围或者集合中。"><code>RangeError</code></a></li>
</ul>
<h2 id="示例">示例</h2>
<pre class="brush: js">var sab = new SharedArrayBuffer(1024);
<pre><code class="language-javascript">var sab = new SharedArrayBuffer(1024);
var ta = new Uint8Array(sab);
ta[0] = 7;
Atomics.compareExchange(ta, 0, 7, 12); // returns 7, the old value
Atomics.load(ta, 0); // 12</pre>
Atomics.load(ta, 0); // 12</code></pre>
<h2 id="规范">规范</h2>
<table class="standard-table">
<tbody>