diff options
| author | Ryan Johnson <rjohnson@mozilla.com> | 2021-04-29 16:16:42 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-29 16:16:42 -0700 |
| commit | 95aca4b4d8fa62815d4bd412fff1a364f842814a (patch) | |
| tree | 5e57661720fe9058d5c7db637e764800b50f9060 /files/it/web/javascript/reference/errors/too_much_recursion | |
| parent | ee3b1c87e3c8e72ca130943eed260ad642246581 (diff) | |
| download | translated-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/errors/too_much_recursion')
| -rw-r--r-- | files/it/web/javascript/reference/errors/too_much_recursion/index.html | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/files/it/web/javascript/reference/errors/too_much_recursion/index.html b/files/it/web/javascript/reference/errors/too_much_recursion/index.html deleted file mode 100644 index 049ed04cf0..0000000000 --- a/files/it/web/javascript/reference/errors/too_much_recursion/index.html +++ /dev/null @@ -1,72 +0,0 @@ ---- -title: 'InternalError: too much recursion' -slug: Web/JavaScript/Reference/Errors/Too_much_recursion -tags: - - Errore - - JavaScript -translation_of: Web/JavaScript/Reference/Errors/Too_much_recursion ---- -<div>{{jsSidebar("Errors")}}</div> - -<p>The JavaScript exception "too much recursion" or "Maximum call stack size exceeded" occurs when there are too many function calls, or a function is missing a base case.</p> - -<h2 id="Message">Message</h2> - -<pre class="syntaxbox notranslate">Error: Spazio nello stack esaurito (Edge) -InternalError: Troppa ricorsione (Firefox) -RangeError: Dimensioni massime dello stack superate (Chrome) -</pre> - -<h2 id="Error_type">Error type</h2> - -<p>{{jsxref("InternalError")}}.</p> - -<h2 id="Cosè_andato_storto">Cos'è andato storto?</h2> - -<p>Una funzione che si chiama da sola si chiama <em>funzione ricorsiva</em>. Una volta che la condizione è soddisfatta, la funzione smette di chiamarsi. Questo si chiama <em>caso di base.</em></p> - -<p>In certi versi, la ricorsione è analoga ai cicli. Entrambi eseguono lo stesso codice più volte, ed entrambi richiedono una condizione(per evitare cicli infiniti,o in questo caso, ricorsioni infinite). Quando ci sono troppe chiamate, o manca il caso di base , JavaScript lancerà questo errore.</p> - -<h2 id="Esempi">Esempi</h2> - -<p>Questa funzione ricorsiva si chiama 10 volte, secondo le condizioni d'uscita</p> - -<pre class="brush: js notranslate">function ciclo(x) { - if (x >= 10) // "x >= 10" condizione d'uscita - return; - // do stuff - ciclo(x + 1); // chiamata ricorsiva -} -ciclo(0);</pre> - -<p>Impostare questa condizione a valori estremamente alti non funzionerà:</p> - -<pre class="brush: js example-bad notranslate">function ciclo(x) { - if (x >= 1000000000000) - return; - // fà cose - ciclo(x + 1); -} -ciclo(0); - -// Errore Interno: troppa ricorsione</pre> - -<p>Alla funzione manca un caso base.Visto che non c'è condizione di uscita, la funzione chiama se stessa all'infinito.</p> - -<pre class="brush: js example-bad notranslate">function ciclo(x) { - // Manca caso base - -ciclo(x + 1); // Chiamata ricorsiva -} - -ciclo(0); - -// Errore Interno: troppa ricorsione</pre> - -<h2 id="Vedi_anche">Vedi anche</h2> - - - -<ul> - <li>{{Glossary("Recursion")}}</li> -</ul> |
