diff options
author | Peter Bengtsson <mail@peterbe.com> | 2021-07-15 12:59:34 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-15 12:59:34 -0400 |
commit | 3601b7bb982e958927e069715cfe07430bce7196 (patch) | |
tree | d305ecdbf80ce8126386a0d7886f70d915277c7c /files/es/web/javascript/reference/deprecated_and_obsolete_features | |
parent | 9ace67d06f2369e3c770e3a11e06e1c8cc9f66fd (diff) | |
download | translated-content-3601b7bb982e958927e069715cfe07430bce7196.tar.gz translated-content-3601b7bb982e958927e069715cfe07430bce7196.tar.bz2 translated-content-3601b7bb982e958927e069715cfe07430bce7196.zip |
delete pages that were never translated from en-US (es, part 1) (#1547)
Diffstat (limited to 'files/es/web/javascript/reference/deprecated_and_obsolete_features')
-rw-r--r-- | files/es/web/javascript/reference/deprecated_and_obsolete_features/the_legacy_iterator_protocol/index.html | 74 |
1 files changed, 0 insertions, 74 deletions
diff --git a/files/es/web/javascript/reference/deprecated_and_obsolete_features/the_legacy_iterator_protocol/index.html b/files/es/web/javascript/reference/deprecated_and_obsolete_features/the_legacy_iterator_protocol/index.html deleted file mode 100644 index 007decfe89..0000000000 --- a/files/es/web/javascript/reference/deprecated_and_obsolete_features/the_legacy_iterator_protocol/index.html +++ /dev/null @@ -1,74 +0,0 @@ ---- -title: The legacy Iterator protocol -slug: >- - Web/JavaScript/Reference/Deprecated_and_obsolete_features/The_legacy_Iterator_protocol -translation_of: >- - Web/JavaScript/Reference/Deprecated_and_obsolete_features/The_legacy_Iterator_protocol -original_slug: >- - Web/JavaScript/Referencia/Características_Desaprobadas/The_legacy_Iterator_protocol ---- -<div>{{jsSidebar("More")}}</div> - -<div class="warning"><strong>Non-standard.</strong> The legacy iterator protocol is a SpiderMonkey-specific feature, and will be removed at some point. For future-facing usages, consider using <a href="/en-US/docs/Web/JavaScript/Reference/Statements/for...of" title="/en-US/docs/Web/JavaScript/Reference/Statements/for...of">for..of</a> loops and the <a href="/en-US/docs/Web/JavaScript/Guide/The_Iterator_protocol">iterator protocol</a>.</div> - -<h2 id="The_deprecated_Firefox-only_iterator_protocol">The deprecated Firefox-only iterator protocol</h2> - -<p>Firefox, prior to version 26 implemented another iterator protocol that is similar to the standard <a href="/en-US/docs/Web/JavaScript/Guide/The_Iterator_protocol">ES6 Iterator protocol</a>.</p> - -<p>An object is an legacy iterator when it implements a <code>next()</code> method with the following semantics, and throws {{jsxref("Global_Objects/StopIteration", "StopIteration")}} at the end of iteration.</p> - -<table class="standard-table"> - <tbody> - <tr> - <th scope="col">Property</th> - <th scope="col">Value</th> - </tr> - <tr> - <td><code>next</code></td> - <td>A zero arguments function that returns an value.</td> - </tr> - </tbody> -</table> - -<h3 id="Difference_between_legacy_and_ES6_iterator_protocols">Difference between legacy and ES6 iterator protocols</h3> - -<ul> - <li>The value was returned directly as a return value of calls to <code>next</code>, instead of the <code>value</code> property of a placeholder object</li> - <li>Iteration termination was expressed by throwing a {{jsxref("Global_Objects/StopIteration", "StopIteration")}} object.</li> -</ul> - -<h3 id="Simple_example_with_the_old_protocol">Simple example with the old protocol</h3> - -<pre class="brush: js">function makeIterator(array){ - var nextIndex = 0; - - return { - next: function(){ - if(nextIndex < array.length){ - return array[nextIndex++]; - else - throw new StopIteration(); - } - } -} - -var it = makeIterator(['yo', 'ya']); - -console.log(it.next()); // 'yo' -console.log(it.next()); // 'ya' -try{ - console.log(it.next()); -} -catch(e){ - if(e instanceof StopIteration){ - // iteration over - } -} -</pre> - -<h2 id="Mira_también">Mira también</h2> - -<ul> - <li><a href="/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators">Iteradores y generadores</a></li> - <li>Más More <a href="/en-US/docs/Web/JavaScript/Reference/Deprecated_and_obsolete_features">características obsoletas</a></li> -</ul> |