diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 21:46:22 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 21:46:22 -0500 |
commit | a065e04d529da1d847b5062a12c46d916408bf32 (patch) | |
tree | fe0f8bcec1ff39a3c499a2708222dcf15224ff70 /files/zh-cn/web/javascript/reference/global_objects/function | |
parent | 218934fa2ed1c702a6d3923d2aa2cc6b43c48684 (diff) | |
download | translated-content-a065e04d529da1d847b5062a12c46d916408bf32.tar.gz translated-content-a065e04d529da1d847b5062a12c46d916408bf32.tar.bz2 translated-content-a065e04d529da1d847b5062a12c46d916408bf32.zip |
update based on https://github.com/mdn/yari/issues/2028
Diffstat (limited to 'files/zh-cn/web/javascript/reference/global_objects/function')
-rw-r--r-- | files/zh-cn/web/javascript/reference/global_objects/function/arity/index.html | 16 | ||||
-rw-r--r-- | files/zh-cn/web/javascript/reference/global_objects/function/isgenerator/index.html | 40 |
2 files changed, 0 insertions, 56 deletions
diff --git a/files/zh-cn/web/javascript/reference/global_objects/function/arity/index.html b/files/zh-cn/web/javascript/reference/global_objects/function/arity/index.html deleted file mode 100644 index d8e8668ca2..0000000000 --- a/files/zh-cn/web/javascript/reference/global_objects/function/arity/index.html +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: Function.arity -slug: Web/JavaScript/Reference/Global_Objects/Function/arity -translation_of: Archive/Web/JavaScript/Function.arity ---- -<div> -<div>{{JSRef("Global_Objects", "Function")}} {{obsolete_header}}</div> -</div> - -<h2 id="Summary" name="Summary">概述</h2> - -<p>返回一个函数的形参数量.</p> - -<h2 id="Description" name="Description">描述</h2> - -<p class="note"><code>arity</code>是一个古老的已经没有浏览器支持的属性,你应该使用<code><a href="/zh-CN/docs/JavaScript/Reference/Global_Objects/Function/length" title="JavaScript/Reference/Global_Objects/Function/length">Function.prototype.length</a></code>属性来代替.</p> diff --git a/files/zh-cn/web/javascript/reference/global_objects/function/isgenerator/index.html b/files/zh-cn/web/javascript/reference/global_objects/function/isgenerator/index.html deleted file mode 100644 index f377f0a210..0000000000 --- a/files/zh-cn/web/javascript/reference/global_objects/function/isgenerator/index.html +++ /dev/null @@ -1,40 +0,0 @@ ---- -title: Function.prototype.isGenerator() -slug: Web/JavaScript/Reference/Global_Objects/Function/isGenerator -translation_of: Archive/Web/JavaScript/Function.isGenerator ---- -<div>{{JSRef("Global_Objects", "Function")}} {{non-standard_header}}</div> - -<h2 id="概述">概述</h2> - -<p>判断一个函数是否是一个<a href="/zh-cn/JavaScript/Guide/Iterators_and_Generators#Generators.3a_a_better_way_to_build_Iterators" title="zh-cn/Core JavaScript 1.5 Guide/Iterators and Generators#Generators.3a a better way to build Iterators">生成器</a>.</p> - -<h2 id="语法">语法</h2> - -<pre class="syntaxbox"><code><var>fun</var>.isGenerator()</code></pre> - -<h2 id="描述">描述</h2> - -<p>该方法用来判断一个函数是否是一个<a href="/zh-cn/JavaScript/Guide/Iterators_and_Generators#Generators.3a_a_better_way_to_build_Iterators" title="zh-cn/Core JavaScript 1.5 Guide/Iterators and Generators#Generators.3a a better way to build Iterators">生成器</a>.</p> - -<h2 id="例子">例子</h2> - -<pre class="brush: js">function f() {} -function* g() { - yield 42; -} -console.log("f.isGenerator() = " + f.isGenerator()); -console.log("g.isGenerator() = " + g.isGenerator()); -</pre> - -<p>上面代码的输出结果为</p> - -<pre>f.isGenerator() = false -g.isGenerator() = true -</pre> - -<h2 id="相关链接">相关链接</h2> - -<ul> - <li><a href="/zh-cn/JavaScript/Guide/Iterators_and_Generators" title="zh-cn/Core JavaScript 1.5 Guide/Iterators and Generators">迭代器和生成器</a></li> -</ul> |