aboutsummaryrefslogtreecommitdiff
path: root/files/it/web/javascript/reference/operators/yield
diff options
context:
space:
mode:
authorRyan Johnson <rjohnson@mozilla.com>2021-04-29 16:16:42 -0700
committerGitHub <noreply@github.com>2021-04-29 16:16:42 -0700
commit95aca4b4d8fa62815d4bd412fff1a364f842814a (patch)
tree5e57661720fe9058d5c7db637e764800b50f9060 /files/it/web/javascript/reference/operators/yield
parentee3b1c87e3c8e72ca130943eed260ad642246581 (diff)
downloadtranslated-content-95aca4b4d8fa62815d4bd412fff1a364f842814a.tar.gz
translated-content-95aca4b4d8fa62815d4bd412fff1a364f842814a.tar.bz2
translated-content-95aca4b4d8fa62815d4bd412fff1a364f842814a.zip
remove retired locales (#699)
Diffstat (limited to 'files/it/web/javascript/reference/operators/yield')
-rw-r--r--files/it/web/javascript/reference/operators/yield/index.html163
1 files changed, 0 insertions, 163 deletions
diff --git a/files/it/web/javascript/reference/operators/yield/index.html b/files/it/web/javascript/reference/operators/yield/index.html
deleted file mode 100644
index cd7fe6adfa..0000000000
--- a/files/it/web/javascript/reference/operators/yield/index.html
+++ /dev/null
@@ -1,163 +0,0 @@
----
-title: yield
-slug: Web/JavaScript/Reference/Operators/yield
-translation_of: Web/JavaScript/Reference/Operators/yield
----
-<div>{{jsSidebar("Operators")}}</div>
-
-<p>La parola chiave <em>yield </em>è usata per mettere in pausa e far ripartire un generatore di funzione ({{jsxref("Statements/function*", "function*")}} or <a href="/en-US/docs/Web/JavaScript/Reference/Statements/Legacy_generator_function">legacy generator function</a>).</p>
-
-<h2 id="Sintassi">Sintassi</h2>
-
-<pre class="syntaxbox">[<em>rv</em>] = <strong>yield</strong> [<em>expression</em>];</pre>
-
-<dl>
- <dt><code>espressione</code></dt>
- <dd>Definisce il valore da ritornare dalla funzione generatore attraverso <a href="/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#iterator">the iterator protocol</a>. Se omesso, <code>undefined</code> viene restituito.</dd>
- <dt><code>rv</code></dt>
- <dd>Permette che il generatore catturi il valore dell'espressione per usarlo al prossimo avvio dell'esecuzione.</dd>
-</dl>
-
-<h2 id="Descrizione">Descrizione</h2>
-
-<p>The <code>yield</code> keyword causes generator function execution to pause and the value of the expression following the <code>yield</code> keyword is returned to the generator's caller. It can be thought of as a generator-based version of the <code>return</code> keyword.</p>
-
-<p>The <code>yield</code> keyword actually returns an <code>IteratorResult</code> object with two properties, <code>value</code> and <code>done</code>. The <code>value</code> property is the result of evaluating the <code>yield</code> expression, and <code>done</code> is a Boolean indicating whether or not the generator function has fully completed.</p>
-
-<p>Once paused on a <code>yield</code> expression, the generator's code execution remains paused until the generator's <code>next()</code> method is called. Each time the generator's <code>next()</code> method is called, the generator resumes execution and runs until it reaches one of the following:</p>
-
-<ul>
- <li> A <code>yield</code>, which causes the generator to once again pause and return the generator's new value. The next time <code>next()</code> is called, execution resumes with the statement immediately after the <code>yield</code>.</li>
- <li>{{jsxref("Statements/throw", "throw")}} is used to throw an exception from the generator. This halts execution of the generator entirely, and execution resumes in the caller as is normally the case when an exception is thrown.</li>
- <li>The end of the generator function is reached; in this case, execution of the generator ends and an <code>IteratorResult</code> is returned to the caller in which the <code>value</code> is {{jsxref("undefined")}} and <code>done</code> is <code>true</code>.</li>
- <li>A {{jsxref("Statements/return", "return")}} statement is reached. In this case, execution of the generator ends and an <code>IteratorResult</code> is returned to the caller in which the <code>value</code> is the value specified by the <code>return</code> statement and <code>done</code> is <code>true</code>.</li>
-</ul>
-
-<p>If an optional value is passed to the generator's <code>next()</code> method, that value becomes the value returned by the generator's next <code>yield</code> operation.</p>
-
-<p>Between the generator's code path, its <code>yield</code> operators, and the ability to specify a new starting value by passing it to {{jsxref("Generator.prototype.next()")}}, generators offer enormous power and control.</p>
-
-<h2 id="Examples">Examples</h2>
-
-<p>The following code is the declaration of an example generator function, along with a helper function.</p>
-
-<pre class="brush: js">function* foo(){
- var index = 0;
- while (index &lt;= 2) // when index reaches 3,
- // yield's done will be true
- // and its value will be undefined;
- yield index++;
-}</pre>
-
-<p>Once a generator function is defined, it can be used by constructing an iterator as shown.</p>
-
-<pre class="brush: js">var iterator = foo();
-console.log(iterator.next()); // { value: 0, done: false }
-console.log(iterator.next()); // { value: 1, done: false }
-console.log(iterator.next()); // { value: 2, done: false }
-console.log(iterator.next()); // { value: undefined, done: true }</pre>
-
-<h2 id="Specifications">Specifications</h2>
-
-<table class="standard-table">
- <thead>
- <tr>
- <th scope="col">Specification</th>
- <th scope="col">Status</th>
- <th scope="col">Comment</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>{{SpecName('ES2015', '#', 'Yield')}}</td>
- <td>{{Spec2('ES2015')}}</td>
- <td>Initial definition.</td>
- </tr>
- </tbody>
-</table>
-
-<h2 id="Browser_compatibility">Browser compatibility</h2>
-
-<p>{{CompatibilityTable}}</p>
-
-<div id="compat-desktop">
-<table class="compat-table">
- <tbody>
- <tr>
- <th>Feature</th>
- <th>Chrome</th>
- <th>Firefox (Gecko)</th>
- <th>Internet Explorer</th>
- <th>Opera</th>
- <th>Safari (WebKit)</th>
- </tr>
- <tr>
- <td>Basic support</td>
- <td>39</td>
- <td>{{CompatGeckoDesktop("26.0")}}</td>
- <td>{{CompatUnknown}}</td>
- <td>{{CompatUnknown}}</td>
- <td>{{CompatUnknown}}</td>
- </tr>
- <tr>
- <td><code>IteratorResult</code> object instead of throwing</td>
- <td>{{CompatUnknown}}</td>
- <td>{{CompatGeckoDesktop("29.0")}}</td>
- <td>{{CompatUnknown}}</td>
- <td>{{CompatUnknown}}</td>
- <td>{{CompatUnknown}}</td>
- </tr>
- </tbody>
-</table>
-</div>
-
-<div id="compat-mobile">
-<table class="compat-table">
- <tbody>
- <tr>
- <th>Feature</th>
- <th>Android</th>
- <th>Firefox Mobile (Gecko)</th>
- <th>IE Mobile</th>
- <th>Opera Mobile</th>
- <th>Safari Mobile</th>
- </tr>
- <tr>
- <td>Basic support</td>
- <td>{{CompatVersionUnknown}}</td>
- <td>{{CompatGeckoMobile("26.0")}}</td>
- <td>{{CompatUnknown}}</td>
- <td>{{ CompatUnknown}}</td>
- <td>{{CompatUnknown}}</td>
- </tr>
- <tr>
- <td><code>IteratorResult</code> object instead of throwing</td>
- <td>{{CompatUnknown}}</td>
- <td>{{CompatGeckoMobile("29.0")}}</td>
- <td>{{CompatUnknown}}</td>
- <td>{{CompatUnknown}}</td>
- <td>{{CompatUnknown}}</td>
- </tr>
- </tbody>
-</table>
-</div>
-
-<h2 id="Firefox-specific_notes">Firefox-specific notes</h2>
-
-<ul>
- <li>Starting with Gecko 29 {{geckoRelease(29)}}, the completed generator function no longer throws a {{jsxref("TypeError")}} "generator has already finished". Instead, it returns an <code>IteratorResult</code> object like <code>{ value: undefined, done: true }</code> ({{bug(958951)}}).</li>
- <li>Starting with Gecko 33 {{geckoRelease(33)}}, the parsing of the <code>yield</code> expression has been updated to conform with the latest ES2015 specification ({{bug(981599)}}):
- <ul>
- <li>The expression after the <code>yield</code> keyword is optional and omitting it no longer throws a {{jsxref("SyntaxError")}}: <code>function* foo() { yield; }</code></li>
- </ul>
- </li>
-</ul>
-
-<h2 id="See_also">See also</h2>
-
-<ul>
- <li><a href="/en-US/docs/Web/JavaScript/Guide/The_Iterator_protocol">The Iterator protocol</a></li>
- <li>{{jsxref("Statements/function*", "function*")}}</li>
- <li>{{jsxref("Operators/function*", "function* expression")}}</li>
- <li>{{jsxref("Operators/yield*", "yield*")}}</li>
-</ul>