aboutsummaryrefslogtreecommitdiff
path: root/files/it/web/javascript/reference/global_objects/function
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/global_objects/function
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/global_objects/function')
-rw-r--r--files/it/web/javascript/reference/global_objects/function/apply/index.html250
-rw-r--r--files/it/web/javascript/reference/global_objects/function/arguments/index.html92
-rw-r--r--files/it/web/javascript/reference/global_objects/function/bind/index.html277
-rw-r--r--files/it/web/javascript/reference/global_objects/function/call/index.html175
-rw-r--r--files/it/web/javascript/reference/global_objects/function/index.html237
-rw-r--r--files/it/web/javascript/reference/global_objects/function/length/index.html87
6 files changed, 0 insertions, 1118 deletions
diff --git a/files/it/web/javascript/reference/global_objects/function/apply/index.html b/files/it/web/javascript/reference/global_objects/function/apply/index.html
deleted file mode 100644
index 1c0d04272d..0000000000
--- a/files/it/web/javascript/reference/global_objects/function/apply/index.html
+++ /dev/null
@@ -1,250 +0,0 @@
----
-title: Function.prototype.apply()
-slug: Web/JavaScript/Reference/Global_Objects/Function/apply
-tags:
- - JavaScript
- - funzione
- - metodo
-translation_of: Web/JavaScript/Reference/Global_Objects/Function/apply
----
-<div>
-<p>{{JSRef}}</p>
-
-<p>Il metodo <code><strong>apply()</strong></code> chiama una funzione passandole il "<code>this</code>" ed i parametri forniti sottoforma di array (o <a href="/en-US/docs/Web/JavaScript/Guide/Indexed_collections#Working_with_array-like_objects">array-like object</a>).</p>
-
-<p><strong>Nota:</strong> Mentre la sintassi di questa funzione è quasi completamente identica a quella di {{jsxref("Function.call", "call()")}}, la fondamentale differenza è che <code>call()</code> accetta una <strong>lista di parametri</strong>, mentre <code>apply()</code> accetta un <strong>singolo array contenente una lista di parametri</strong>.</p>
-
-<h2 id="Sintassi">Sintassi</h2>
-
-<pre><code><var>fun</var>.apply(<var>thisArg, </var>[<var>argsArray</var>])</code></pre>
-
-<h3 id="Parametri">Parametri</h3>
-
-<dl>
- <dt><code>thisArg</code></dt>
- <dd>Il valore del <code>this</code> da fornire alla chiamata a <em><code>fun</code></em>. Nota che questo potrebbe non essere l'effettivo valore visto dal metodo: se il metodo non è eseguito in {{jsxref("Strict_mode", "strict mode", "", 1)}}, {{jsxref("null")}} ed {{jsxref("undefined")}} saranno rimpiazzati dall'oggetto globale.</dd>
- <dt><code>argsArray</code></dt>
- <dd>Un array-like object che specifica i parametri con la quale la funzione <em><code>fun</code></em> deve essere chiamata. Può essere anche {{jsxref("null")}} o {{jsxref("undefined")}} nel caso nessun parametro dovesse essere passato. A partire da ECMAScript 5 questi parametri possono essere un qualunque array-like object invece di un semplice array. Vedi sotto per le {{anch("Browser_compatibility", "compatibilità nei browser")}}.</dd>
-</dl>
-
-<h2 id="Descrizione">Descrizione</h2>
-
-<p><code>this</code> solitamente si riferisce all'oggetto corrente, ma grazie ad <code>apply</code> è possibile scrivere un metodo una sola volta e riusarlo più volte su oggetti differenti passando ad apply, appunto, un this differente. Cosi viene eliminata la necessità di riscrivere di nuovo lo stesso metodo per un oggetto diverso.</p>
-
-<p><code>apply</code> è molto simile a {{jsxref("Function.call", "call()")}}, eccezion fatta per il modo in cui i parametri vengono passati. Puoi utilizzare un array di parametri invece della solita lista. Con <code>apply</code>, ad esempio, puoi utilizzare il seguente array literal: <code><em>fun</em>.apply(this, ['eat', 'bananas'])</code>, o il seguente oggetto {{jsxref("Array")}}: <code><em>fun</em>.apply(this, new Array('eat', 'bananas'))</code>.</p>
-
-<p>Puoi anche utilizzare {{jsxref("Functions/arguments", "arguments")}} per il parametro <code>argsArray<font face="Open Sans, Arial, sans-serif">. </font></code><code>arguments</code> è una variabile locale di tutte le funzioni. Può essere utilizzata per tutti i parametri non specificati dell'oggetto chiamato. In più, non è necessario che si conoscano i parametri dell'oggetto chiamato quando si utilizza apply.</p>
-
-<p>Da ECMAScript 5 puoi anche usare qualunque tipo di array-like object. Ad esempio puoi utilizzare un {{domxref("NodeList")}} o un oggetto come <code>{ 'length': 2, '0': 'eat', '1': 'bananas' }</code>.</p>
-
-<p>{{note("La maggior parte dei browser, incluso Chrome 14 ed Internet Explorer 9, non accetto array-like objects e lanceranno una eccezione.")}}</p>
-
-<h2 id="Esempi">Esempi</h2>
-
-<h3 id="Utilizzare_apply_per_concatenare_costruttori">Utilizzare apply per concatenare costruttori</h3>
-
-<p>Puoi utilizzare apply per concatenare {{jsxref("Operators/new", "costruttori", "", 1)}} per un oggetto, in maniera simile a Java. Nel seguente esempio creeremo una {{jsxref("Function")}} globale chiamata <code>construct</code>, che ti permetterà di utilizzare un array-like object con un costruttore anziché una lista di argomenti.</p>
-
-<pre>Function.prototype.construct = function (aArgs) {
-  var oNew = Object.create(this.prototype);
-  this.apply(oNew, aArgs);
-  return oNew;
-};
-</pre>
-
-<p><strong>Note:</strong> Il metodo <code>Object.create()</code> usato nell'esempio sovrastante è relativamente nuovo. Per un alternativa che utilizza le closures considera questo pezzo di codice:</p>
-
-<pre>Function.prototype.construct = function(aArgs) {
-  var fConstructor = this, fNewConstr = function() {
- fConstructor.apply(this, aArgs);
- };
-  fNewConstr.prototype = fConstructor.prototype;
-  return new fNewConstr();
-};</pre>
-
-<p>Esempio d'uso:</p>
-
-<pre>function MyConstructor() {
- for (var nProp = 0; nProp &lt; arguments.length; nProp++) {
- this['property' + nProp] = arguments[nProp];
- }
-}
-
-var myArray = [4, 'Hello world!', false];
-var myInstance = MyConstructor.construct(myArray);
-
-console.log(myInstance.property1); // logs 'Hello world!'
-console.log(myInstance instanceof MyConstructor); // logs 'true'
-console.log(myInstance.constructor); // logs 'MyConstructor'
-</pre>
-
-<p><strong>Note:</strong> Il metodo non nativo <code>Function.construct</code> non funzionerà con alcuni costruttori nativi (come {{jsxref("Date")}}). In questi casi devi usare {{jsxref("Function.prototype.bind")}}. Immagina ad esempio di avere un array come il seguente da utilizzare con il costruttore {{jsxref("Global_Objects/Date", "Date")}}: <code>[2012, 11, 4]</code>; In questo caso dovresti scrivere qualcosa come: <code>new (Function.prototype.bind.apply(Date, [null].concat([2012, 11, 4])))()</code> — ad ogni modo questo non è il miglior modo di fare le cose e non andrebbe mai usato in produzione.</p>
-
-<h3 id="Utilizzare_apply_combinato_alle_funzioni_built-in">Utilizzare apply combinato alle funzioni built-in</h3>
-
-<p>Un intelligente uso di <code>apply</code> ti permette di utilizzare delle funzioni built-in per dei compiti che altrimenti sarebbero stati fatti, nel caso sottostante, ciclando l'array e scorrendo ogni suo elemento e sottoponendolo a dei controlli. L'esempio seguente dimostra come trovare il massimo / minimo valore all'interno di un array utilizzando <code>Math.max</code>/<code>Math.min</code>.</p>
-
-<pre>// min/max number in an array
-var numbers = [5, 6, 2, 3, 7];
-
-// using Math.min/Math.max apply
-var max = Math.max.apply(null, numbers);
-// This about equal to Math.max(numbers[0], ...)
-// or Math.max(5, 6, ...)
-
-var min = Math.min.apply(null, numbers);
-
-// vs. simple loop based algorithm
-max = -Infinity, min = +Infinity;
-
-for (var i = 0; i &lt; numbers.length; i++) {
- if (numbers[i] &gt; max) {
- max = numbers[i];
- }
- if (numbers[i] &lt; min) {
- min = numbers[i];
- }
-}
-</pre>
-
-<p>Ma tieni a mente che nell'usare apply in questo modo si corre il rischio di superare il limite imposto dal motore JavaScript degli argomenti che possono essere passati ad una funzione.<br>
- Le conseguenze nel fare ciò variano da motore a motore (ad esempio JavaScriptCore ha il limite settato a mano di <a href="https://bugs.webkit.org/show_bug.cgi?id=80797">65536</a> parametri), perché il limite non è specificato. Alcuni motori lanceranno una eccezione. Altri invece limiteranno arbitrariamente il numero dei parametri passati alla funzione su cui viene usato il metodo <em><code>apply().</code></em> (Un esempio di quest'ultimo caso potrebbe essere quello di un motore che ha questo limite settato a 4 e, nell'esempio sovrastante, gli unici parametri che effettivamente saranno passati alla funzione saranno <code>5, 6, 2, 3</code>, piuttosto che l'intero array.) Una decisione saggia, nel caso si prevede la possibilità di raggiungere un enorme numero di parametri, sarebbe quella di parzializzare il numero di parametri per lotti:</p>
-
-<pre>function minOfArray(arr) {
- var min = Infinity;
- var QUANTUM = 32768;
-
- for (var i = 0, len = arr.length; i &lt; len; i += QUANTUM) {
- var submin = Math.min.apply(null, arr.slice(i, Math.min(i+QUANTUM, len)));
- min = Math.min(submin, min);
- }
-
- return min;
-}
-
-var min = minOfArray([5, 6, 2, 3, 7]);
-</pre>
-
-<h3 id="Usare_apply_come_monkey-patch">Usare apply come "monkey-patch"</h3>
-
-<p>L'attività del "monkey-patching" consiste nel modificare il funzionamento di un metodo senza dover andare a mettere mano al codice sorgente (cosa da evitare sempre e comunque). Difatti Apply può rivelarsi il modo migliore di modificare il funzionamento, ad esempio, di una funzione interna a Firefox o di una qualunque altra libreria JS. Data una funzione <code>someobject.foo</code>, è possibile modificarne il funzionamento in questo modo:</p>
-
-<pre>var originalfoo = someobject.foo;
-someobject.foo = function() {
- // Do stuff before calling function
- console.log(arguments);
- // Call the function as it would have been called normally:
- originalfoo.apply(this, arguments);
- // Run stuff after, here.
-}
-</pre>
-
-<p>Questo metodo ritorna particolarmente utile quando vuoi debuggare eventi e interfacce con qualcosa che non espone API come i diversi eventi <code>.on([event]...</code> (usabili anche dal <a href="/en-US/docs/Tools/Page_Inspector#Developer_API">Devtools Inspector</a>).</p>
-
-<h2 id="Specifiche">Specifiche</h2>
-
-<table>
- <tbody>
- <tr>
- <th scope="col">Specifica</th>
- <th scope="col">Stato</th>
- <th scope="col">Commento</th>
- </tr>
- <tr>
- <td>{{SpecName('ES3')}}</td>
- <td>{{Spec2('ES3')}}</td>
- <td>Definizione iniziale. Implementato in JavaScript 1.3.</td>
- </tr>
- <tr>
- <td>{{SpecName('ES5.1', '#sec-15.3.4.3', 'Function.prototype.apply')}}</td>
- <td>{{Spec2('ES5.1')}}</td>
- <td> </td>
- </tr>
- <tr>
- <td>{{SpecName('ES6', '#sec-function.prototype.apply', 'Function.prototype.apply')}}</td>
- <td>{{Spec2('ES6')}}</td>
- <td> </td>
- </tr>
- <tr>
- <td>{{SpecName('ESDraft', '#sec-function.prototype.apply', 'Function.prototype.apply')}}</td>
- <td>{{Spec2('ESDraft')}}</td>
- <td> </td>
- </tr>
- </tbody>
-</table>
-
-<h2 id="Compatibilità_Browser">Compatibilità Browser</h2>
-
-<p>{{CompatibilityTable}}</p>
-
-<table>
- <tbody>
- <tr>
- <th>Feature</th>
- <th>Chrome</th>
- <th>Firefox (Gecko)</th>
- <th>Internet Explorer</th>
- <th>Opera</th>
- <th>Safari</th>
- </tr>
- <tr>
- <td>Supporto base</td>
- <td>{{CompatVersionUnknown}}</td>
- <td>{{CompatVersionUnknown}}</td>
- <td>{{CompatVersionUnknown}}</td>
- <td>{{CompatVersionUnknown}}</td>
- <td>{{CompatVersionUnknown}}</td>
- </tr>
- <tr>
- <td>ES 5.1 generico array-like object come {{jsxref("Functions/arguments", "arguments")}}</td>
- <td>{{CompatUnknown}}</td>
- <td>{{CompatGeckoDesktop("2.0")}}</td>
- <td>{{CompatUnknown}}</td>
- <td>{{CompatUnknown}}</td>
- <td>{{CompatUnknown}}</td>
- </tr>
- </tbody>
-</table>
-
-<table>
- <tbody>
- <tr>
- <th>Feature</th>
- <th>Android</th>
- <th>Chrome for Android</th>
- <th>Firefox Mobile (Gecko)</th>
- <th>IE Mobile</th>
- <th>Opera Mobile</th>
- <th>Safari Mobile</th>
- </tr>
- <tr>
- <td>Supporto base</td>
- <td>{{CompatVersionUnknown}}</td>
- <td>{{CompatVersionUnknown}}</td>
- <td>{{CompatVersionUnknown}}</td>
- <td>{{CompatVersionUnknown}}</td>
- <td>{{CompatVersionUnknown}}</td>
- <td>{{CompatVersionUnknown}}</td>
- </tr>
- <tr>
- <td>ES 5.1 generico array-like object come {{jsxref("Functions/arguments", "arguments")}}</td>
- <td>{{CompatUnknown}}</td>
- <td>{{CompatUnknown}}</td>
- <td>{{CompatGeckoMobile("2.0")}}</td>
- <td>{{CompatUnknown}}</td>
- <td>{{CompatUnknown}}</td>
- <td>{{CompatUnknown}}</td>
- </tr>
- </tbody>
-</table>
-
-<h2 id="Vedi_anche">Vedi anche</h2>
-
-<ul>
- <li>{{jsxref("Functions/arguments", "arguments")}} object</li>
- <li>{{jsxref("Function.prototype.bind()")}}</li>
- <li>{{jsxref("Function.prototype.call()")}}</li>
- <li>{{jsxref("Functions", "Functions and function scope", "", 1)}}</li>
- <li>{{jsxref("Reflect.apply()")}}</li>
-</ul>
-</div>
diff --git a/files/it/web/javascript/reference/global_objects/function/arguments/index.html b/files/it/web/javascript/reference/global_objects/function/arguments/index.html
deleted file mode 100644
index 949e5f9cdb..0000000000
--- a/files/it/web/javascript/reference/global_objects/function/arguments/index.html
+++ /dev/null
@@ -1,92 +0,0 @@
----
-title: Function.arguments
-slug: Web/JavaScript/Reference/Global_Objects/Function/arguments
-tags:
- - Deprecated
- - Function
- - JavaScript
- - Property
- - arguments
-translation_of: Web/JavaScript/Reference/Global_Objects/Function/arguments
----
-<div>{{JSRef}} {{deprecated_header}}</div>
-
-<p>La proprieta' <code><strong><em>function</em>.arguments</strong></code> fa riferimento ad un oggetto simile ad un array corrispondente ai parametri passati ad una funzione. Usa questa semplice variabile {{jsxref("Functions/arguments", "arguments")}} invece. Questa proprieta' non e' disponibile in strict mode.</p>
-
-<h2 id="Descrizione">Descrizione</h2>
-
-<p><code><font face="Arial, x-locale-body, sans-serif"><span style="background-color: #ffffff;">La sintassi </span></font><em>function</em>.arguments</code> e' deprecata. Il metodo consigliato per accedere all'oggetto {{jsxref("Functions/arguments", "arguments")}}, disponibile all'interno delle funzioni e' semplicemente mediante l'utilizzo di {{jsxref("Functions/arguments", "arguments")}}.</p>
-
-<p>In caso di ricorsione, per esempio, se la funzione <code>f</code> e' presente diverse volte nello stack, il valore di <code>f.arguments</code> rappresenta i parametri corrispondenti alla chiamata alla funzione piu' recente.</p>
-
-<p>Il valore della proprieta' arguments e' normalmente null se non c'e' una sua chiamata durante l'esecuzione della funzione (ovvero quando la funzione e' stata chiamata ma non ha ancora ritornato nessun valore).</p>
-
-<h2 id="Esempi">Esempi</h2>
-
-<pre class="brush: js">function f(n) { g(n - 1) }
-
-function g(n) {
- console.log('before: ' + g.arguments[0])
- if (n &gt; 0) { f(n) }
- console.log('after: ' + g.arguments[0])
-}
-
-f(2)
-
-console.log('returned: ' + g.arguments)
-
-// Output
-
-// before: 1
-// before: 0
-// after: 0
-// after: 1
-// returned: null
-</pre>
-
-<h2 id="Specifiche">Specifiche</h2>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <th scope="col">Specification</th>
- <th scope="col">Status</th>
- <th scope="col">Comment</th>
- </tr>
- <tr>
- <td>{{SpecName('ES1')}}</td>
- <td>{{Spec2('ES1')}}</td>
- <td>Initial definition. Implemented in JavaScript 1.0. Deprecated in favor of {{jsxref("Functions/arguments", "arguments")}} in ES3.</td>
- </tr>
- <tr>
- <td>{{SpecName('ES5.1', '#sec-10.6', 'arguments object')}}</td>
- <td>{{Spec2('ES5.1')}}</td>
- <td>{{jsxref("Functions/arguments", "arguments")}} object</td>
- </tr>
- <tr>
- <td>{{SpecName('ES6', '#sec-arguments-object', 'arguments object')}}</td>
- <td>{{Spec2('ES6')}}</td>
- <td>{{jsxref("Functions/arguments", "arguments")}} object</td>
- </tr>
- <tr>
- <td>{{SpecName('ESDraft', '#sec-arguments-object', 'arguments object')}}</td>
- <td>{{Spec2('ESDraft')}}</td>
- <td>{{jsxref("Functions/arguments", "arguments")}} object</td>
- </tr>
- </tbody>
-</table>
-
-<h2 id="Compatibilita_Browser">Compatibilita' Browser</h2>
-
-<div>
-
-
-<p>{{Compat("javascript.builtins.Function.arguments")}}</p>
-</div>
-
-<h2 id="See_also">See also</h2>
-
-<ul>
- <li>{{jsxref("Functions/arguments", "arguments")}} object</li>
- <li>{{jsxref("Functions", "Functions and function scope", "", 1)}}</li>
-</ul>
diff --git a/files/it/web/javascript/reference/global_objects/function/bind/index.html b/files/it/web/javascript/reference/global_objects/function/bind/index.html
deleted file mode 100644
index 38187ac5e6..0000000000
--- a/files/it/web/javascript/reference/global_objects/function/bind/index.html
+++ /dev/null
@@ -1,277 +0,0 @@
----
-title: Function.prototype.bind()
-slug: Web/JavaScript/Reference/Global_Objects/Function/bind
-translation_of: Web/JavaScript/Reference/Global_Objects/Function/bind
----
-<div>{{JSRef}}</div>
-
-<p>Il metodo <code><strong>bind()</strong></code> crea una nuova funzione che, quando chiamata, ha parola chiave <strong><code>this</code></strong> impostata sul valore fornito, con una data sequenza di argomenti che precede quella fornita quando viene chiamata la nuova funzione</p>
-
-<p>{{EmbedInteractiveExample("pages/js/function-bind.html", "taller")}}</p>
-
-<p class="hidden">La fonte per questo esempio interattivo è memorizzata in un repository GitHub. Se desideri contribuire al progetto di esempi interattivi, ti preghiamo di clonare. <a href="https://github.com/mdn/interactive-examples">https://github.com/mdn/interactive-examples</a> e inviarci una richiesta di pull.</p>
-
-<h2 id="Sintassi">Sintassi</h2>
-
-<pre class="syntaxbox"><code><var>function</var></code>.bind(<var>thisArg</var>[, <var>arg1</var>[, <var>arg2</var>[, ...]]])</pre>
-
-<h3 id="Parametri">Parametri</h3>
-
-<dl>
- <dt><code>thisArg</code></dt>
- <dd>Il valore va passato come parametro alla funzione target quando viene chiamata la funzione associata. Il valore viene ignorato se la funzione associata viene costruita utilizzando l'operatore {{jsxref("Operators/new", "new")}}. Quando si utilizza <code>bind</code> per creare una funzione (fornita come callback) all'interno di un setTimeout, qualsiasi valore primitivo passato come <code>thisArg</code> viene convertito in oggetto. Se non vengono forniti argomenti per vincolarlo, l'esecuzione viene considerata come <code>thisArg</code> per la nuova funzione.</dd>
- <dt><code>arg1, arg2, ...</code></dt>
- <dd>Argomenti da anteporre agli argomenti forniti alla funzione associata quando si richiama la funzione di destinazione.</dd>
-</dl>
-
-<h3 id="Valore_restituito">Valore restituito</h3>
-
-<p>Una copia della funzione data con specificato <strong><code>this</code></strong> valore e gli argomenti iniziali.</p>
-
-<h2 id="Descrizione">Descrizione</h2>
-
-<p>La funzione <code>bind()</code> crea una nuova <strong>funzione associata</strong> <strong>(BF, bound function)</strong>. Un BF è un <em>exotic function object </em>(oggetto funzione esotico, un termine di ECMAScript 2015) che racchiude l'oggetto funzione originale. Chiamare un BF generalmente comporta l'esecuzione della sua funzione <em>wrapped</em> (avvolta).<br>
- Un BF ha le seguenti proprietà interne:</p>
-
-<ul>
- <li><strong>[[BoundTargetFunction]]</strong> - l'oggetto funzione avvolto;</li>
- <li><strong>[[BoundThis]]</strong> - il valore che viene sempre passato come questo valore quando si chiama la funzione wrapped.</li>
- <li><strong>[[BoundArguments]] - </strong>un elenco di valori i cui elementi vengono utilizzati come primi argomenti per qualsiasi chiamata alla funzione wrapped.</li>
- <li><strong>[[Call]]</strong> - esegue il codice associato a questo oggetto. Invocato tramite un'espressione di chiamata di funzione. Gli argomenti del metodo interno sono un valore e un elenco contenente gli argomenti passati alla funzione da un'espressione di chiamata.</li>
-</ul>
-
-<p>Quando viene chiamata la funzione associata, chiama il metodo interno <strong>[[Call]]</strong> su<strong> [[BoundTargetFunction]]</strong>, con i seguenti argomenti <code>call(boundThis, ...args)</code>. Dove, <code>boundThis</code> è <strong>[[BoundThis]]</strong>, <code>args</code> è <strong>[[BoundArguments]] </strong>seguito dagli argomenti passati dalla chiamata alla funzione.</p>
-
-<p>Una funzione associata (bound function) può anche essere costruita usando l'operatore <a href="/it/docs/Web/JavaScript/Reference/Operators/new">new</a>: agendo in tal modo si comporta come se la funzione obiettivo fosse stata invece costruita. Il valore <code>this</code> fornito viene ignorato, mentre gli argomenti preposti sono forniti alla funzione emulata.</p>
-
-<h2 id="Esempi">Esempi</h2>
-
-<h3 id="Creare_una_funzione_associata">Creare una funzione associata</h3>
-
-<p>L'uso più semplice di <code>bind()</code> è di creare una funzione che, indipendentemente da come viene chiamata, viene chiamata con un particolare valore. Un errore comune per i nuovi programmatori JavaScript consiste nell'estrarre un metodo da un oggetto, in seguito chiamare tale funzione e aspettarsi che utilizzi l'oggetto originale come tale (ad esempio, utilizzando tale metodo nel codice basato sul callback). Senza particolare cura, tuttavia, l'oggetto originale viene solitamente perso. La creazione di una funzione associata dalla funzione, utilizzando l'oggetto originale, risolve in modo chiaro questo problema:</p>
-
-<pre class="brush: js">this.x = 9; // questo si riferisce all'oggetto "finestra" globale qui nel browser
-var module = {
- x: 81,
- getX: function() { return this.x; }
-};
-
-module.getX(); // 81
-
-var retrieveX = module.getX;
-retrieveX();
-// returns 9 - restituisce 9 - La funzione viene richiamata nell'ambito globale
-
-// Create a new function with 'this' bound to module
-// Crea una nuova funzione con 'this' associato al modulo
-// I nuovi programmatori potrebbero confondere il
-// global var x con la proprietà del modulo x <code>var boundGetX = retrieveX.bind(module);</code>
-boundGetX(); // 81
-</pre>
-
-<h3 id="Funzioni_parzialmente_applicate">Funzioni parzialmente applicate</h3>
-
-<p>Il prossimo uso più semplice di bind() è quello di creare una funzione con argomenti iniziali pre-specificati. Questi argomenti (se presenti) seguono il valore fornito e vengono quindi inseriti all'inizio degli argomenti passati alla funzione di destinazione, seguiti dagli argomenti passati alla funzione associata, ogni volta che viene chiamata la funzione associata.</p>
-
-<pre class="brush: js">function list() {
- return Array.prototype.slice.call(arguments);
-}
-
-var list1 = list(1, 2, 3); // [1, 2, 3]
-
-// Crea una funzione con un argomento principale preimpostato
-var leadingThirtysevenList = list.bind(null, 37);
-
-var list2 = leadingThirtysevenList();
-// [37]
-
-var list3 = leadingThirtysevenList(1, 2, 3);
-// [37, 1, 2, 3]
-</pre>
-
-<h3 id="Con_setTimeout">Con <code>setTimeout</code></h3>
-
-<p>Di default all'interno di {{domxref("window.setTimeout()")}}, la parola chiave <code>this</code> verrà impostata sull'oggetto {{ domxref("window") }} (or <code>global</code>). Quando si lavora con metodi di classe che richiedono questo <code>this</code> riferimento alle istanze di classe, è possibile associarlo esplicitamente alla funzione di callback, al fine di mantenere l'istanza.</p>
-
-<pre class="brush: js">function LateBloomer() {
- this.petalCount = Math.floor(Math.random() * 12) + 1;
-}
-
-// Dichiarare apertura dopo un ritardo di 1 secondo
-LateBloomer.prototype.bloom = function() {
- window.setTimeout(this.declare.bind(this), 1000);
-};
-
-LateBloomer.prototype.declare = function() {
- console.log('Sono un bel fiore con ' +
- this.petalCount + ' petali!');
-};
-
-var flower = new LateBloomer();
-flower.bloom();
-// dopo 1 secondo, attiva il metodo 'declare'</pre>
-
-<h3 id="Funzioni_associate_utilizzate_come_costruttori">Funzioni associate utilizzate come costruttori</h3>
-
-<div class="warning">
-<p><strong>Warning:</strong> Questa sezione dimostra capacità JavaScript e documenta alcuni casi limite del metodo bind(). I metodi mostrati di seguito non sono il modo migliore di fare le cose e probabilmente non dovrebbero essere usati in nessun ambiente di produzione.</p>
-</div>
-
-<p>Le funzioni associate sono automaticamente utilizzabili con l'operatore {{jsxref("Operators/new", "new")}} per costruire nuove istanze create dalla funzione target. Quando una funzione associata viene utilizzata per costruire un valore, la condizione viene ignorata. Tuttavia, gli argomenti forniti sono ancora preposti alla chiamata del costruttore:</p>
-
-<pre class="brush: js">function Point(x, y) {
- this.x = x;
- this.y = y;
-}
-
-Point.prototype.toString = function() {
- return this.x + ',' + this.y;
-};
-
-var p = new Point(1, 2);
-p.toString(); // '1,2'
-
-// non supportato nel polyfill di seguito,
-// funziona bene con il bind nativo:
-
-var YAxisPoint = Point.bind(null, 0/*x*/);
-
-
-var emptyObj = {};
-var YAxisPoint = Point.bind(emptyObj, 0/*x*/);
-
-var axisPoint = new YAxisPoint(5);
-axisPoint.toString(); // '0,5'
-
-axisPoint instanceof Point; // true
-axisPoint instanceof YAxisPoint; // true
-new Point(17, 42) instanceof YAxisPoint; // true
-</pre>
-
-<p>Note that you need do nothing special to create a bound function for use with {{jsxref("Operators/new", "new")}}. The corollary is that you need do nothing special to create a bound function to be called plainly, even if you would rather require the bound function to only be called using {{jsxref("Operators/new", "new")}}.</p>
-
-<pre class="brush: js">// Example can be run directly in your JavaScript console
-// ...continuing from above
-
-// Can still be called as a normal function
-// (although usually this is undesired)
-YAxisPoint(13);
-
-emptyObj.x + ',' + emptyObj.y;
-// &gt; '0,13'
-</pre>
-
-<p>If you wish to support the use of a bound function only using {{jsxref("Operators/new", "new")}}, or only by calling it, the target function must enforce that restriction.</p>
-
-<h3 id="Creating_shortcuts">Creating shortcuts</h3>
-
-<p><code>bind()</code> is also helpful in cases where you want to create a shortcut to a function which requires a specific <strong><code>this</code></strong> value.</p>
-
-<p>Take {{jsxref("Array.prototype.slice")}}, for example, which you want to use for converting an array-like object to a real array. You could create a shortcut like this:</p>
-
-<pre class="brush: js">var slice = Array.prototype.slice;
-
-// ...
-
-slice.apply(arguments);
-</pre>
-
-<p>With <code>bind()</code>, this can be simplified. In the following piece of code, <code>slice</code> is a bound function to the {{jsxref("Function.prototype.apply()", "apply()")}} function of {{jsxref("Function.prototype")}}, with the <strong><code>this</code></strong> value set to the {{jsxref("Array.prototype.slice()", "slice()")}} function of {{jsxref("Array.prototype")}}. This means that additional <code>apply()</code> calls can be eliminated:</p>
-
-<pre class="brush: js">// same as "slice" in the previous example
-var unboundSlice = Array.prototype.slice;
-var slice = Function.prototype.apply.bind(unboundSlice);
-
-// ...
-
-slice(arguments);
-</pre>
-
-<h2 id="Polyfill">Polyfill</h2>
-
-<p>You can partially work around this by inserting the following code at the beginning of your scripts, allowing use of much of the functionality of <code>bind()</code> in implementations that do not natively support it.</p>
-
-<pre class="brush: js">if (!Function.prototype.bind) {
- Function.prototype.bind = function(oThis) {
- if (typeof this !== 'function') {
- // closest thing possible to the ECMAScript 5
- // internal IsCallable function
- throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable');
- }
-
- var aArgs = Array.prototype.slice.call(arguments, 1),
- fToBind = this,
- fNOP = function() {},
- fBound = function() {
- return fToBind.apply(this instanceof fNOP
- ? this
- : oThis,
- aArgs.concat(Array.prototype.slice.call(arguments)));
- };
-
- if (this.prototype) {
- // Function.prototype doesn't have a prototype property
- fNOP.prototype = this.prototype;
- }
- fBound.prototype = new fNOP();
-
- return fBound;
- };
-}
-</pre>
-
-<p>Some of the many differences (there may well be others, as this list does not seriously attempt to be exhaustive) between this algorithm and the specified algorithm are:</p>
-
-<ul>
- <li>The partial implementation relies on {{jsxref("Array.prototype.slice()")}}, {{jsxref("Array.prototype.concat()")}}, {{jsxref("Function.prototype.call()")}} and {{jsxref("Function.prototype.apply()")}}, built-in methods to have their original values.</li>
- <li>The partial implementation creates functions that do not have immutable "poison pill" {{jsxref("Function.caller", "caller")}} and <code>arguments</code> properties that throw a {{jsxref("Global_Objects/TypeError", "TypeError")}} upon get, set, or deletion. (This could be added if the implementation supports {{jsxref("Object.defineProperty")}}, or partially implemented [without throw-on-delete behavior] if the implementation supports the {{jsxref("Object.defineGetter", "__defineGetter__")}} and {{jsxref("Object.defineSetter", "__defineSetter__")}} extensions.)</li>
- <li>The partial implementation creates functions that have a <code>prototype</code> property. (Proper bound functions have none.)</li>
- <li>The partial implementation creates bound functions whose {{jsxref("Function.length", "length")}} property does not agree with that mandated by ECMA-262: it creates functions with length 0, while a full implementation, depending on the length of the target function and the number of pre-specified arguments, may return a non-zero length.</li>
-</ul>
-
-<p>If you choose to use this partial implementation, <strong>you must not rely on those cases where behavior deviates from ECMA-262, 5th edition!</strong> With some care, however (and perhaps with additional modification to suit specific needs), this partial implementation may be a reasonable bridge to the time when <code>bind()</code> is widely implemented according to the specification.</p>
-
-<p>Please check <a href="https://github.com/Raynos/function-bind">https://github.com/Raynos/function-bind</a> for a more thorough solution!</p>
-
-<h2 id="Specifications">Specifications</h2>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <th scope="col">Specification</th>
- <th scope="col">Status</th>
- <th scope="col">Comment</th>
- </tr>
- <tr>
- <td>{{SpecName('ES5.1', '#sec-15.3.4.5', 'Function.prototype.bind')}}</td>
- <td>{{Spec2('ES5.1')}}</td>
- <td>Initial definition. Implemented in JavaScript 1.8.5.</td>
- </tr>
- <tr>
- <td>{{SpecName('ES2015', '#sec-function.prototype.bind', 'Function.prototype.bind')}}</td>
- <td>{{Spec2('ES2015')}}</td>
- <td></td>
- </tr>
- <tr>
- <td>{{SpecName('ESDraft', '#sec-function.prototype.bind', 'Function.prototype.bind')}}</td>
- <td>{{Spec2('ESDraft')}}</td>
- <td></td>
- </tr>
- </tbody>
-</table>
-
-<h2 id="Browser_compatibility">Browser compatibility</h2>
-
-<div>
-
-
-<p>{{Compat("javascript.builtins.Function.bind")}}</p>
-</div>
-
-<h2 id="See_also">See also</h2>
-
-<ul>
- <li>{{jsxref("Function.prototype.apply()")}}</li>
- <li>{{jsxref("Function.prototype.call()")}}</li>
- <li>{{jsxref("Functions", "Functions", "", 1)}}</li>
-</ul>
diff --git a/files/it/web/javascript/reference/global_objects/function/call/index.html b/files/it/web/javascript/reference/global_objects/function/call/index.html
deleted file mode 100644
index 54acd401ca..0000000000
--- a/files/it/web/javascript/reference/global_objects/function/call/index.html
+++ /dev/null
@@ -1,175 +0,0 @@
----
-title: Function.prototype.call()
-slug: Web/JavaScript/Reference/Global_Objects/Function/call
-translation_of: Web/JavaScript/Reference/Global_Objects/Function/call
----
-<div>{{JSRef}}</div>
-
-<p><span class="seoSummary">Il metodo <code><strong>call()</strong></code> esegue una funzione con un dato valore <code>this</code> e argomenti passati singolarmente.</span></p>
-
-<div class="note">
-<p><strong>Note:</strong> Mentre la sintassi di questa funzione è quasi identica a quella di {{jsxref("Function.prototype.apply", "apply()")}}, la differenza fondamentale è che <code>call()</code> accetta una <strong>lista di argomenti</strong> mentre <code>apply()</code> accetta un <strong>singolo array di argomenti</strong>.</p>
-</div>
-
-<div>{{EmbedInteractiveExample("pages/js/function-call.html")}}</div>
-
-
-
-<h2 id="Sintassi">Sintassi</h2>
-
-<pre class="syntaxbox"><var>func</var>.call([<var>thisArg</var>[, <var>arg1</var>, <var>arg2</var>, ...<var>argN</var>]])</pre>
-
-<h3 id="Parametri">Parametri</h3>
-
-<dl>
- <dt><code><var>thisArg</var></code> {{optional_inline}}</dt>
- <dd>
- <p>Il valore da usare come <code>this</code> quando si esegue <code><var>func</var></code>.</p>
-
- <div class="blockIndicator note">
- <p><strong>Attenzione:</strong> In certi casi, <code><var>thisArg</var></code> potrebbe non essere il valore reale visto dal metodo.</p>
-
- <p>Se il metodo è una funzione in {{jsxref("Strict_mode", "non-strict mode", "", 1)}}, {{jsxref("Global_Objects/null", "null")}} e {{jsxref("Global_Objects/undefined", "undefined")}} sarà sostituito dall'oggetto globale e i valori di tipo primitiva verranno convertiti in oggetti.</p>
- </div>
- </dd>
- <dt><code><var>arg1</var>, <var>arg2</var>, ...<var>argN</var></code> {{optional_inline}}</dt>
- <dd>Argomenti per la funzione.</dd>
-</dl>
-
-<h3 id="Valore_restituito">Valore restituito</h3>
-
-<p>Il risultato dell'esecuzione della funzione con il <code><strong>this</strong></code> e gli argomenti specificati.</p>
-
-<h2 id="Descrizione">Descrizione</h2>
-
-<p>Il metodo <code>call()</code> consente a una funzione/metodo appartenente a un oggetto di essere essere assegnata e chiamata per un oggetto diverso..</p>
-
-<p><code>call()</code> fornisce un nuova valore di <code>this</code> alla funzione/metodo. Con <code>call()</code>, si può scrivere un metodo una volta ed ereditarlo in un altro oggetto senza dover riscrivere il metodo per il nuovo oggetto.</p>
-
-<h2 id="Esempi">Esempi</h2>
-
-<h3 id="Usare_call_per_collegare_costruttori_per_un_oggetto">Usare <code>call</code> per collegare costruttori per un oggetto</h3>
-
-<p>Si può usare <code>call</code> per collegare costruttori per un oggetto (simile a Java).</p>
-
-<p>Nell'esempio seguente, il costruttore per l'oggetto <code>Product</code> è definito con 2 parametri: <code>name</code> e <code>price</code>.</p>
-
-<p>Due altre funzioni, <code>Food</code> e <code>Toy</code>, invocano <code>Product</code>, passando <code>this</code>, <code>name</code>, e <code>price</code>. <code>Product</code> inizializza le proprietà <code>name</code> e <code>price</code>. Entrambe le funzioni specializzate definiscono la <code>category</code>.</p>
-
-<pre class="brush: js">function Product(name, price) {
- this.name = name;
- this.price = price;
-}
-
-function Food(name, price) {
- Product.call(this, name, price);
- this.category = 'food';
-}
-
-function Toy(name, price) {
- Product.call(this, name, price);
- this.category = 'toy';
-}
-
-const cheese = new Food('feta', 5);
-const fun = new Toy('robot', 40);
-</pre>
-
-<h3 id="Usare_call_per_invocare_una_funzione_anonima">Usare <code>call</code> per invocare una funzione anonima</h3>
-
-<p>In questo esempio, viene create una funzione anonima e usato <code>call</code> per invocarla su ogni oggetto di un array.</p>
-
-<p>Lo scopo principale della funzione anonima qui è di aggiungere una funzione <code>print</code> o ogni oggetto il quale è in grado di stampare il corretto indice dell'oggetto nell'array.</p>
-
-<div class="blockIndicator note">
-<p>Passare l'oggetto come valore <code>this</code> non è strettamente necessario ma è fatto a scopo esplicativo.</p>
-</div>
-
-<pre class="brush: js">const animals = [
- { species: 'Lion', name: 'King' },
- { species: 'Whale', name: 'Fail' }
-];
-
-for (let i = 0; i &lt; animals.length; i++) {
- (function(i) {
- this.print = function() {
- console.log('#' + i + ' ' + this.species
- + ': ' + this.name);
- }
- this.print();
- }).call(animals[i], i);
-}
-</pre>
-
-<h3 id="Usare_call_per_invocare_una_funzione_e_specificare_il_contesto_per_this">Usare <code>call</code> per invocare una funzione e specificare il contesto per  '<code>this</code>'</h3>
-
-<p>Nell'esempio sotto, quando viene eseguita <code>greet</code>, il valore di <code>this</code> verrà legato all'oggetto <code>obj</code>.</p>
-
-<pre class="brush: js">function greet() {
- const reply = [this.animal, 'typically sleep between', this.sleepDuration].join(' ');
- console.log(reply);
-}
-
-const obj = {
- animal: 'cats', sleepDuration: '12 and 16 hours'
-};
-
-greet.call(obj); // cats typically sleep between 12 and 16 hours
-</pre>
-
-<h3 id="Usare_call_per_invocare_una_funzione_senza_specificare_il_primo_parametro">Usare <code>call</code> per invocare una funzione senza specificare il primo parametro</h3>
-
-<p>Nell'esempio sotto, viene invocata la funzione <code>display</code> senza passare il primo parametro. Se il primo parametro non è passato il valore di <code>this</code> è legato all'oggetto globale.</p>
-
-<pre class="brush: js">var sData = 'Wisen';
-
-function display() {
- console.log('sData value is %s ', this.sData);
-}
-
-display.call(); // sData value is Wisen</pre>
-
-<div class="note">
-<p><strong>Attenzione:</strong> In strict mode il valore di <code>this</code> sarà <code>undefined</code>. Vedere sotto.</p>
-</div>
-
-<pre class="brush: js">'use strict';
-
-var sData = 'Wisen';
-
-function display() {
- console.log('sData value is %s ', this.sData);
-}
-
-display.call(); // Cannot read the property of 'sData' of undefined</pre>
-
-<h2 id="Specifiche">Specifiche</h2>
-
-<table class="standard-table">
- <thead>
- <tr>
- <th scope="col">Specifiche</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>{{SpecName('ESDraft', '#sec-function.prototype.call', 'Function.prototype.call')}}</td>
- </tr>
- </tbody>
-</table>
-
-<h2 id="Browser_compatibility">Browser compatibility</h2>
-
-
-
-<p>{{Compat("javascript.builtins.Function.call")}}</p>
-
-<h2 id="See_also">See also</h2>
-
-<ul>
- <li>{{jsxref("Function.prototype.bind()")}}</li>
- <li>{{jsxref("Function.prototype.apply()")}}</li>
- <li>
- <p><a href="/en-US/docs/Web/JavaScript/Introduction_to_Object-Oriented_JavaScript">Introduction to Object-Oriented JavaScript</a></p>
- </li>
-</ul>
diff --git a/files/it/web/javascript/reference/global_objects/function/index.html b/files/it/web/javascript/reference/global_objects/function/index.html
deleted file mode 100644
index 4ef63fb80b..0000000000
--- a/files/it/web/javascript/reference/global_objects/function/index.html
+++ /dev/null
@@ -1,237 +0,0 @@
----
-title: Function
-slug: Web/JavaScript/Reference/Global_Objects/Function
-translation_of: Web/JavaScript/Reference/Global_Objects/Function
----
-<div>{{JSRef}}</div>
-
-<p>The <strong><code>Function</code> constructor</strong> creates a new <code>Function</code> object. In JavaScript every function is actually a <code>Function</code> object.</p>
-
-<p>gge</p>
-
-<h2 id="Syntax">Syntax</h2>
-
-<pre class="syntaxbox"><code>new Function ([<var>arg1</var>[, <var>arg2</var>[, ...<var>argN</var>]],] <var>functionBody</var>)</code></pre>
-
-<h3 id="Parameters">Parameters</h3>
-
-<dl>
- <dt><code>arg1, arg2, ... arg<em>N</em></code></dt>
- <dd>Names to be used by the function as formal argument names. Each must be a string that corresponds to a valid JavaScript identifier or a list of such strings separated with a comma; for example "<code>x</code>", "<code>theValue</code>", or "<code>a,b</code>".</dd>
- <dt><code>functionBody</code></dt>
- <dd>A string containing the JavaScript statements comprising the function definition.</dd>
-</dl>
-
-<h2 id="Description">Description</h2>
-
-<p><code>Function</code> objects created with the <code>Function</code> constructor are parsed when the function is created. This is less efficient than declaring a function with a <a href="/en-US/docs/Web/JavaScript/Reference/Operators/function">function expression</a> or <a href="/en-US/docs/Web/JavaScript/Reference/Statements/function">function statement</a> and calling it within your code, because such functions are parsed with the rest of the code.</p>
-
-<p>All arguments passed to the function are treated as the names of the identifiers of the parameters in the function to be created, in the order in which they are passed.</p>
-
-<div class="note">
-<p><strong>Note:</strong> Functions created with the <code>Function</code> constructor do not create closures to their creation contexts; they always are created in the global scope. When running them, they will only be able to access their own local variables and global ones, not the ones from the scope in which the <code>Function</code> constructor was called. This is different from using {{jsxref("eval")}} with code for a function expression.</p>
-</div>
-
-<p>Invoking the <code>Function</code> constructor as a function (without using the <code>new</code> operator) has the same effect as invoking it as a constructor.</p>
-
-<h2 id="Properties_and_Methods_of_Function">Properties and Methods of <code>Function</code></h2>
-
-<p>The global <code>Function</code> object has no methods or properties of its own, however, since it is a function itself it does inherit some methods and properties through the prototype chain from {{jsxref("Function.prototype")}}.</p>
-
-<h2 id="Function_prototype_object"><code>Function</code> prototype object</h2>
-
-<h3 id="Properties">Properties</h3>
-
-<div>{{page('/en-US/docs/JavaScript/Reference/Global_Objects/Function/prototype', 'Properties')}}</div>
-
-<h3 id="Methods">Methods</h3>
-
-<div>{{page('/en-US/docs/JavaScript/Reference/Global_Objects/Function/prototype', 'Methods')}}</div>
-
-<h2 id="Function_instances"><code>Function</code> instances</h2>
-
-<p><code>Function</code> instances inherit methods and properties from {{jsxref("Function.prototype")}}. As with all constructors, you can change the constructor's prototype object to make changes to all <code>Function</code> instances.</p>
-
-<h2 id="Examples">Examples</h2>
-
-<h3 id="Specifying_arguments_with_the_Function_constructor">Specifying arguments with the <code>Function</code> constructor</h3>
-
-<p>The following code creates a <code>Function</code> object that takes two arguments.</p>
-
-<pre class="brush: js">// Example can be run directly in your JavaScript console
-
-// Create a function that takes two arguments and returns the sum of those arguments
-var adder = new Function('a', 'b', 'return a + b');
-
-// Call the function
-adder(2, 6);
-// &gt; 8
-</pre>
-
-<p>The arguments "<code>a</code>" and "<code>b</code>" are formal argument names that are used in the function body, "<code>return a + b</code>".</p>
-
-<h3 id="A_recursive_shortcut_to_massively_modify_the_DOM">A recursive shortcut to massively modify the DOM</h3>
-
-<p>Creating functions with the <code>Function</code> constructor is one of the ways to dynamically create an indeterminate number of new objects with some executable code into the global scope from a function. The following example (a recursive shortcut to massively modify the DOM) is impossible without the invocation of the <code>Function</code> constructor for each new query if you want to avoid closures.</p>
-
-<pre class="brush: html">&lt;!doctype html&gt;
-&lt;html&gt;
-&lt;head&gt;
-&lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt;
-&lt;title&gt;MDN Example - a recursive shortcut to massively modify the DOM&lt;/title&gt;
-&lt;script type="text/javascript"&gt;
-var domQuery = (function() {
- var aDOMFunc = [
- Element.prototype.removeAttribute,
- Element.prototype.setAttribute,
- CSSStyleDeclaration.prototype.removeProperty,
- CSSStyleDeclaration.prototype.setProperty
- ];
-
- function setSomething(bStyle, sProp, sVal) {
- var bSet = Boolean(sVal), fAction = aDOMFunc[bSet | bStyle &lt;&lt; 1],
- aArgs = Array.prototype.slice.call(arguments, 1, bSet ? 3 : 2),
- aNodeList = bStyle ? this.cssNodes : this.nodes;
-
- if (bSet &amp;&amp; bStyle) { aArgs.push(''); }
- for (
- var nItem = 0, nLen = this.nodes.length;
- nItem &lt; nLen;
- fAction.apply(aNodeList[nItem++], aArgs)
- );
- this.follow = setSomething.caller;
- return this;
- }
-
- function setStyles(sProp, sVal) { return setSomething.call(this, true, sProp, sVal); }
- function setAttribs(sProp, sVal) { return setSomething.call(this, false, sProp, sVal); }
- function getSelectors() { return this.selectors; };
- function getNodes() { return this.nodes; };
-
- return (function(sSelectors) {
- var oQuery = new Function('return arguments.callee.follow.apply(arguments.callee, arguments);');
- oQuery.selectors = sSelectors;
- oQuery.nodes = document.querySelectorAll(sSelectors);
- oQuery.cssNodes = Array.prototype.map.call(oQuery.nodes, function(oInlineCSS) { return oInlineCSS.style; });
- oQuery.attributes = setAttribs;
- oQuery.inlineStyle = setStyles;
- oQuery.follow = getNodes;
- oQuery.toString = getSelectors;
- oQuery.valueOf = getNodes;
- return oQuery;
- });
-})();
-&lt;/script&gt;
-&lt;/head&gt;
-
-&lt;body&gt;
-
-&lt;div class="testClass"&gt;Lorem ipsum&lt;/div&gt;
-&lt;p&gt;Some text&lt;/p&gt;
-&lt;div class="testClass"&gt;dolor sit amet&lt;/div&gt;
-
-&lt;script type="text/javascript"&gt;
-domQuery('.testClass')
- .attributes('lang', 'en')('title', 'Risus abundat in ore stultorum')
- .inlineStyle('background-color', 'black')('color', 'white')('width', '100px')('height', '50px');
-&lt;/script&gt;
-&lt;/body&gt;
-
-&lt;/html&gt;
-</pre>
-
-<h2 id="Specifications">Specifications</h2>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <th scope="col">Specification</th>
- <th scope="col">Status</th>
- <th scope="col">Comment</th>
- </tr>
- <tr>
- <td>{{SpecName('ES1')}}</td>
- <td>{{Spec2('ES1')}}</td>
- <td>Initial definition. Implemented in JavaScript 1.0.</td>
- </tr>
- <tr>
- <td>{{SpecName('ES5.1', '#sec-15.3', 'Function')}}</td>
- <td>{{Spec2('ES5.1')}}</td>
- <td></td>
- </tr>
- <tr>
- <td>{{SpecName('ES6', '#sec-function-objects', 'Function')}}</td>
- <td>{{Spec2('ES6')}}</td>
- <td></td>
- </tr>
- <tr>
- <td>{{SpecName('ESDraft', '#sec-function-objects', 'Function')}}</td>
- <td>{{Spec2('ESDraft')}}</td>
- <td></td>
- </tr>
- </tbody>
-</table>
-
-<h2 id="Browser_compatibility">Browser compatibility</h2>
-
-<div>{{CompatibilityTable}}</div>
-
-<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</th>
- </tr>
- <tr>
- <td>Basic support</td>
- <td>{{CompatVersionUnknown}}</td>
- <td>{{CompatVersionUnknown}}</td>
- <td>{{CompatVersionUnknown}}</td>
- <td>{{CompatVersionUnknown}}</td>
- <td>{{CompatVersionUnknown}}</td>
- </tr>
- </tbody>
-</table>
-</div>
-
-<div id="compat-mobile">
-<table class="compat-table">
- <tbody>
- <tr>
- <th>Feature</th>
- <th>Android</th>
- <th>Chrome for 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>{{CompatVersionUnknown}}</td>
- <td>{{CompatVersionUnknown}}</td>
- <td>{{CompatVersionUnknown}}</td>
- <td>{{CompatVersionUnknown}}</td>
- <td>{{CompatVersionUnknown}}</td>
- </tr>
- </tbody>
-</table>
-</div>
-
-<h2 id="See_also">See also</h2>
-
-<ul>
- <li>{{jsxref("Functions", "Functions and function scope")}}</li>
- <li>{{jsxref("Function")}}</li>
- <li>{{jsxref("Statements/function", "function statement")}}</li>
- <li>{{jsxref("Operators/function", "function expression")}}</li>
- <li>{{jsxref("Statements/function*", "function* statement")}}</li>
- <li>{{jsxref("Operators/function*", "function* expression")}}</li>
- <li>{{jsxref("GeneratorFunction")}}</li>
-</ul>
diff --git a/files/it/web/javascript/reference/global_objects/function/length/index.html b/files/it/web/javascript/reference/global_objects/function/length/index.html
deleted file mode 100644
index 6e305fb3ed..0000000000
--- a/files/it/web/javascript/reference/global_objects/function/length/index.html
+++ /dev/null
@@ -1,87 +0,0 @@
----
-title: Function.length
-slug: Web/JavaScript/Reference/Global_Objects/Function/length
-translation_of: Web/JavaScript/Reference/Global_Objects/Function/length
----
-<div>{{JSRef}}</div>
-
-<p>La proprietà <code><strong>length</strong></code> indica il numero di parametri che la funzione si aspetta di ricevere.</p>
-
-<p>{{EmbedInteractiveExample("pages/js/function-length.html")}}</p>
-
-
-
-<div>{{js_property_attributes(0,0,1)}}</div>
-
-<h2 id="Description">Description</h2>
-
-<p><code>length</code> è una proprietà di un oggetto {{jsxref("Function")}} che indica quanti argomenti la funzione si aspetta, cioè il numero di parametri formali. Questo numero esclude il {{jsxref("rest_parameters", "rest parameter", "", 1)}} e include solo i parametri prima del primo con un valore predefinito. Al contrario, {{jsxref("Functions_and_function_scope/arguments/length", "arguments.length")}} è locale a una funzione e fornisce il numero di argomenti effettivamente passati alla funzione.</p>
-
-<h3 id="Data_property_of_the_Function_constructor">Data property of the Function constructor</h3>
-
-<p>Il costruttore  {{jsxref("Function")}} è esso stesso un oggetto {{jsxref("Function")}}. La sua proprietà <code>length</code> ha valore 1. Gli attributi delle proprietà sono: Writable: <code>false</code>, Enumerable: <code>false</code>, Configurable: <code>false</code>.</p>
-
-<h3 id="Property_of_the_Function_prototype_object">Property of the Function prototype object</h3>
-
-<p>La proprietà <code>length</code> del prototype di un oggetto {{jsxref("Function")}} ha valore 0.</p>
-
-<h2 id="Examples">Examples</h2>
-
-<pre class="brush: js">console.log(Function.length); /* 1 */
-
-console.log((function() {}).length); /* 0 */
-console.log((function(a) {}).length); /* 1 */
-console.log((function(a, b) {}).length); /* 2 etc. */
-
-console.log((function(...args) {}).length);
-// 0, rest parameter is not counted
-
-console.log((function(a, b = 1, c) {}).length);
-// 1, only parameters before the first one with
-// a default value is counted</pre>
-
-<h2 id="Specifications">Specifications</h2>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <th scope="col">Specification</th>
- <th scope="col">Status</th>
- <th scope="col">Comment</th>
- </tr>
- <tr>
- <td>{{SpecName('ES1')}}</td>
- <td>{{Spec2('ES1')}}</td>
- <td>Definizione iniziale. Implementata in JavaScript 1.1.</td>
- </tr>
- <tr>
- <td>{{SpecName('ES5.1', '#sec-15.3.5.1', 'Function.length')}}</td>
- <td>{{Spec2('ES5.1')}}</td>
- <td></td>
- </tr>
- <tr>
- <td>{{SpecName('ES6', '#sec-function-instances-length', 'Function.length')}}</td>
- <td>{{Spec2('ES6')}}</td>
- <td>Gli attributi <font face="consolas, Liberation Mono, courier, monospace"><span style="background-color: rgba(220, 220, 220, 0.5);">configurabili</span></font> di queste proprietà diventano <code>true</code>.</td>
- </tr>
- <tr>
- <td>{{SpecName('ESDraft', '#sec-function-instances-length', 'Function.length')}}</td>
- <td>{{Spec2('ESDraft')}}</td>
- <td></td>
- </tr>
- </tbody>
-</table>
-
-<h2 id="Browser_compatibility">Browser compatibility</h2>
-
-<div>
-
-
-<p>{{Compat("javascript.builtins.Function.length")}}</p>
-</div>
-
-<h2 id="See_also">See also</h2>
-
-<ul>
- <li>{{jsxref("Function")}}</li>
-</ul>