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

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

@@ -4,7 +4,7 @@
<div><iframe class="interactive interactive-js" frameborder="0" height="250" src="https://interactive-examples.mdn.mozilla.net/pages/js/promise-race.html" width="100%"></iframe></div>
<p class="hidden">The source for this interactive demo is stored in a GitHub repository. If you'd like to contribute to the interactive demo 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="Syntax" name="Syntax">语法</h2>
<pre class="syntaxbox"><var>Promise.race(iterable)</var>;</pre>
<pre><code class="language-javascript"><var>Promise.race(iterable)</var>;</code></pre>
<h3 id="参数"><strong>参数</strong></h3>
<dl>
<dt>iterable</dt>
@@ -35,9 +35,9 @@ setTimeout(function(){
// logs, in order:
// Promise { &lt;state&gt;: "pending" }
// the stack is now empty
// Promise { &lt;state&gt;: "fulfilled", &lt;value&gt;: 33 }</code></pre>
// Promise { &lt;state&gt;: "fulfilled", &lt;value&gt;: 33 }</code></code></pre>
<h3 id="使用_Promise.race__setTimeout_的示例"><code><font face="Open Sans, sans-serif">使用 </font>Promise.race</code>  <code>setTimeout 的示例</code></h3>
<pre class="brush: js">var p1 = new Promise(function(resolve, reject) {
<pre><code class="language-javascript">var p1 = new Promise(function(resolve, reject) {
setTimeout(resolve, 500, "one");
});
var p2 = new Promise(function(resolve, reject) {
@@ -76,7 +76,7 @@ Promise.race([p5, p6]).then(function(value) {
console.log(reason); // "six"
// p6 更快,所以它失败了
});
</pre>
</code></pre>
<h2 id="规范">规范</h2>
<table class="standard-table">
<tbody>