diff options
author | Florian Merz <me@fiji-flo.de> | 2021-02-11 14:47:54 +0100 |
---|---|---|
committer | Florian Merz <me@fiji-flo.de> | 2021-02-11 14:47:54 +0100 |
commit | 30feb96f6084a2fb976a24ac01c1f4a054611b62 (patch) | |
tree | d73194ae27b60156ff0ca54013c8c4ad8519f10a /files/it/web/javascript/reference | |
parent | 8260a606c143e6b55a467edf017a56bdcd6cba7e (diff) | |
download | translated-content-30feb96f6084a2fb976a24ac01c1f4a054611b62.tar.gz translated-content-30feb96f6084a2fb976a24ac01c1f4a054611b62.tar.bz2 translated-content-30feb96f6084a2fb976a24ac01c1f4a054611b62.zip |
unslug it: move
Diffstat (limited to 'files/it/web/javascript/reference')
-rw-r--r-- | files/it/web/javascript/reference/classes/constructor/index.html (renamed from files/it/web/javascript/reference/classes/costruttore/index.html) | 0 | ||||
-rw-r--r-- | files/it/web/javascript/reference/functions/arguments/index.html (renamed from files/it/web/javascript/reference/functions_and_function_scope/arguments/index.html) | 0 | ||||
-rw-r--r-- | files/it/web/javascript/reference/functions/arrow_functions/index.html (renamed from files/it/web/javascript/reference/functions_and_function_scope/arrow_functions/index.html) | 0 | ||||
-rw-r--r-- | files/it/web/javascript/reference/functions/get/index.html (renamed from files/it/web/javascript/reference/functions_and_function_scope/get/index.html) | 0 | ||||
-rw-r--r-- | files/it/web/javascript/reference/functions/index.html (renamed from files/it/web/javascript/reference/functions_and_function_scope/index.html) | 0 | ||||
-rw-r--r-- | files/it/web/javascript/reference/functions/set/index.html (renamed from files/it/web/javascript/reference/functions_and_function_scope/set/index.html) | 0 | ||||
-rw-r--r-- | files/it/web/javascript/reference/global_objects/array/prototype/index.html | 203 | ||||
-rw-r--r-- | files/it/web/javascript/reference/global_objects/object/prototype/index.html | 215 | ||||
-rw-r--r-- | files/it/web/javascript/reference/global_objects/proxy/proxy/apply/index.html (renamed from files/it/web/javascript/reference/global_objects/proxy/handler/apply/index.html) | 0 | ||||
-rw-r--r-- | files/it/web/javascript/reference/global_objects/proxy/proxy/index.html (renamed from files/it/web/javascript/reference/global_objects/proxy/handler/index.html) | 0 | ||||
-rw-r--r-- | files/it/web/javascript/reference/global_objects/proxy/revocable/index.html (renamed from files/it/web/javascript/reference/global_objects/proxy/revocabile/index.html) | 0 | ||||
-rw-r--r-- | files/it/web/javascript/reference/global_objects/string/prototype/index.html | 179 | ||||
-rw-r--r-- | files/it/web/javascript/reference/operators/comma_operator/index.html (renamed from files/it/web/javascript/reference/operators/operatore_virgola/index.html) | 0 | ||||
-rw-r--r-- | files/it/web/javascript/reference/operators/conditional_operator/index.html (renamed from files/it/web/javascript/reference/operators/operator_condizionale/index.html) | 0 | ||||
-rw-r--r-- | files/it/web/javascript/reference/operators/operatori_aritmetici/index.html | 292 | ||||
-rw-r--r-- | files/it/web/javascript/reference/template_literals/index.html (renamed from files/it/web/javascript/reference/template_strings/index.html) | 0 |
16 files changed, 0 insertions, 889 deletions
diff --git a/files/it/web/javascript/reference/classes/costruttore/index.html b/files/it/web/javascript/reference/classes/constructor/index.html index afc6c44526..afc6c44526 100644 --- a/files/it/web/javascript/reference/classes/costruttore/index.html +++ b/files/it/web/javascript/reference/classes/constructor/index.html diff --git a/files/it/web/javascript/reference/functions_and_function_scope/arguments/index.html b/files/it/web/javascript/reference/functions/arguments/index.html index c277074bca..c277074bca 100644 --- a/files/it/web/javascript/reference/functions_and_function_scope/arguments/index.html +++ b/files/it/web/javascript/reference/functions/arguments/index.html diff --git a/files/it/web/javascript/reference/functions_and_function_scope/arrow_functions/index.html b/files/it/web/javascript/reference/functions/arrow_functions/index.html index 2dd258966d..2dd258966d 100644 --- a/files/it/web/javascript/reference/functions_and_function_scope/arrow_functions/index.html +++ b/files/it/web/javascript/reference/functions/arrow_functions/index.html diff --git a/files/it/web/javascript/reference/functions_and_function_scope/get/index.html b/files/it/web/javascript/reference/functions/get/index.html index 0ed76cf469..0ed76cf469 100644 --- a/files/it/web/javascript/reference/functions_and_function_scope/get/index.html +++ b/files/it/web/javascript/reference/functions/get/index.html diff --git a/files/it/web/javascript/reference/functions_and_function_scope/index.html b/files/it/web/javascript/reference/functions/index.html index 8a5255282c..8a5255282c 100644 --- a/files/it/web/javascript/reference/functions_and_function_scope/index.html +++ b/files/it/web/javascript/reference/functions/index.html diff --git a/files/it/web/javascript/reference/functions_and_function_scope/set/index.html b/files/it/web/javascript/reference/functions/set/index.html index 1af0f1c79d..1af0f1c79d 100644 --- a/files/it/web/javascript/reference/functions_and_function_scope/set/index.html +++ b/files/it/web/javascript/reference/functions/set/index.html diff --git a/files/it/web/javascript/reference/global_objects/array/prototype/index.html b/files/it/web/javascript/reference/global_objects/array/prototype/index.html deleted file mode 100644 index d4989792a8..0000000000 --- a/files/it/web/javascript/reference/global_objects/array/prototype/index.html +++ /dev/null @@ -1,203 +0,0 @@ ---- -title: Array.prototype -slug: Web/JavaScript/Reference/Global_Objects/Array/prototype -translation_of: Web/JavaScript/Reference/Global_Objects/Array/prototype ---- -<div>{{JSRef}}</div> - -<p>La proprietà <strong><code>Array.prototype</code></strong> rappresenta il prototipo per il costruttore {{jsxref("Array")}} .</p> - -<div>{{js_property_attributes(0, 0, 0)}}</div> - -<h2 id="Description" name="Description">Descrizione</h2> - -<p>Le istanze {{jsxref("Array")}} ereditano da <code>Array.prototype</code>. Come con gli altri costruttori, si può cambiare il prototipo propagando i cambiamenti su tutte le sue istanze.</p> - -<p>Piccola curiosità: <code>Array.prototype</code> è un {{jsxref("Array")}}:</p> - -<pre class="brush: js">Array.isArray(Array.prototype); // true -</pre> - -<h2 id="Properties" name="Properties">Proprietà</h2> - -<dl> - <dt><code>Array.prototype.constructor</code></dt> - <dd>Restituisce il costruttore.</dd> - <dt>{{jsxref("Array.prototype.length")}}</dt> - <dd>Restituisce il numero di elementi in un array.</dd> -</dl> - -<h2 id="Methods" name="Methods">Metodi</h2> - -<h3 id="Mutator_methods" name="Mutator_methods">Metodi mutator</h3> - -<p>Questi metodi modificano l'array:</p> - -<dl> - <dt>{{jsxref("Array.prototype.copyWithin()")}} {{experimental_inline}}</dt> - <dd>Copia una sequenza di elementi dell'array all'interno dello stesso.</dd> - <dt>{{jsxref("Array.prototype.fill()")}} {{experimental_inline}}</dt> - <dd>Riempie le posizioni dell'array contenute tra 2 indici con un valore fisso.</dd> - <dt>{{jsxref("Array.prototype.pop()")}}</dt> - <dd>Rimuove e restituisce l'ultimo elemento dell'array.</dd> - <dt>{{jsxref("Array.prototype.push()")}}</dt> - <dd>Accoda uno o più elementi all'array e restituisce la lunghezza aggiornata dello stesso.</dd> - <dt>{{jsxref("Array.prototype.reverse()")}}</dt> - <dd>Inverte l'ordine delle posizioni degli elementi all'interno dell'array.</dd> - <dt>{{jsxref("Array.prototype.shift()")}}</dt> - <dd>Rimuove e resistuisce il primo elemento di un array.</dd> - <dt>{{jsxref("Array.prototype.sort()")}}</dt> - <dd>Ordina gli elementi di un array all'interno di esso e restituisce l'array.</dd> - <dt>{{jsxref("Array.prototype.splice()")}}</dt> - <dd>Aggiunge e/o rimuove elementi da un array.</dd> - <dt>{{jsxref("Array.prototype.unshift()")}}</dt> - <dd>Aggiunge uno o più elementi all'inizio di un array e restituisce la lunghezza aggiornata dello stesso.</dd> -</dl> - -<h3 id="Accessor_methods" name="Accessor_methods">Metodi accessor</h3> - -<p>Questi metodi non modificano l'array e ne restituiscono una sua rappresentazione.</p> - -<dl> - <dt>{{jsxref("Array.prototype.concat()")}}</dt> - <dd>Restituisce un nuovo array costituito dall'array stesso insieme ad altri array/valori.</dd> - <dt>{{jsxref("Array.prototype.includes()")}} {{experimental_inline}}</dt> - <dd>Restituisce <code>true</code> se l'array contiene un certo elemento, <code>false</code> altrimenti.</dd> - <dt>{{jsxref("Array.prototype.join()")}}</dt> - <dd>Resituisce i valori dell'array come stringa.</dd> - <dt>{{jsxref("Array.prototype.slice()")}}</dt> - <dd>Restituisce un nuovo array cosituito da elementi dell'array originale.</dd> - <dt>{{jsxref("Array.prototype.toSource()")}} {{non-standard_inline}}</dt> - <dd>Returns an array literal representing the specified array; you can use this value to create a new array. Overrides the {{jsxref("Object.prototype.toSource()")}} method.</dd> - <dt>{{jsxref("Array.prototype.toString()")}}</dt> - <dd>Returns a string representing the array and its elements. Overrides the {{jsxref("Object.prototype.toString()")}} method.</dd> - <dt>{{jsxref("Array.prototype.toLocaleString()")}}</dt> - <dd>Returns a localized string representing the array and its elements. Overrides the {{jsxref("Object.prototype.toLocaleString()")}} method.</dd> - <dt>{{jsxref("Array.prototype.indexOf()")}}</dt> - <dd>Returns the first (least) index of an element within the array equal to the specified value, or -1 if none is found.</dd> - <dt>{{jsxref("Array.prototype.lastIndexOf()")}}</dt> - <dd>Returns the last (greatest) index of an element within the array equal to the specified value, or -1 if none is found.</dd> -</dl> - -<h3 id="Iteration_methods" name="Iteration_methods">Iteration methods</h3> - -<p>Several methods take as arguments functions to be called back while processing the array. When these methods are called, the <code>length</code> of the array is sampled, and any element added beyond this length from within the callback is not visited. Other changes to the array (setting the value of or deleting an element) may affect the results of the operation if the method visits the changed element afterwards. While the specific behavior of these methods in such cases is well-defined, you should not rely upon it so as not to confuse others who might read your code. If you must mutate the array, copy into a new array instead.</p> - -<dl> - <dt>{{jsxref("Array.prototype.forEach()")}}</dt> - <dd>Calls a function for each element in the array.</dd> - <dt>{{jsxref("Array.prototype.entries()")}} {{experimental_inline}}</dt> - <dd>Returns a new <code>Array Iterator</code> object that contains the key/value pairs for each index in the array.</dd> - <dt>{{jsxref("Array.prototype.every()")}}</dt> - <dd>Returns true if every element in this array satisfies the provided testing function.</dd> - <dt>{{jsxref("Array.prototype.some()")}}</dt> - <dd>Returns true if at least one element in this array satisfies the provided testing function.</dd> - <dt>{{jsxref("Array.prototype.filter()")}}</dt> - <dd>Creates a new array with all of the elements of this array for which the provided filtering function returns true.</dd> - <dt>{{jsxref("Array.prototype.find()")}} {{experimental_inline}}</dt> - <dd>Returns the found value in the array, if an element in the array satisfies the provided testing function or <code>undefined</code> if not found.</dd> - <dt>{{jsxref("Array.prototype.findIndex()")}} {{experimental_inline}}</dt> - <dd>Returns the found index in the array, if an element in the array satisfies the provided testing function or -1 if not found.</dd> - <dt>{{jsxref("Array.prototype.keys()")}} {{experimental_inline}}</dt> - <dd>Returns a new <code>Array Iterator</code> that contains the keys for each index in the array.</dd> - <dt>{{jsxref("Array.prototype.map()")}}</dt> - <dd>Creates a new array with the results of calling a provided function on every element in this array.</dd> - <dt>{{jsxref("Array.prototype.reduce()")}}</dt> - <dd>Apply a function against an accumulator and each value of the array (from left-to-right) as to reduce it to a single value.</dd> - <dt>{{jsxref("Array.prototype.reduceRight()")}}</dt> - <dd>Apply a function against an accumulator and each value of the array (from right-to-left) as to reduce it to a single value.</dd> - <dt>{{jsxref("Array.prototype.values()")}} {{experimental_inline}}</dt> - <dd>Returns a new <code>Array Iterator</code> object that contains the values for each index in the array.</dd> - <dt>{{jsxref("Array.prototype.@@iterator()", "Array.prototype[@@iterator]()")}} {{experimental_inline}}</dt> - <dd>Returns a new <code>Array Iterator</code> object that contains the values for each index in the array.</dd> -</dl> - -<h3 id="Generic_methods" name="Generic_methods">Generic methods</h3> - -<p>Many methods on the JavaScript Array object are designed to be generally applied to all objects which “look like” Arrays. That is, they can be used on any object which has a <code>length</code> property, and which can usefully be accessed using numeric property names (as with <code>array[5]</code> indexing). <span class="comment">TODO: give examples with Array.prototype.forEach.call, and adding the method to an object like {{jsxref("Global_Objects/JavaArray", "JavaArray")}} or {{jsxref("Global_Objects/String", "String")}}.</span> Some methods, such as {{jsxref("Array.join", "join")}}, only read the <code>length</code> and numeric properties of the object they are called on. Others, like {{jsxref("Array.reverse", "reverse")}}, require that the object's numeric properties and <code>length</code> be mutable; these methods can therefore not be called on objects like {{jsxref("String")}}, which does not permit its <code>length</code> property or synthesized numeric properties to be set.</p> - -<h2 id="Specifications" name="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.</td> - </tr> - <tr> - <td>{{SpecName('ES5.1', '#sec-15.4.3.1', 'Array.prototype')}}</td> - <td>{{Spec2('ES5.1')}}</td> - <td> </td> - </tr> - <tr> - <td>{{SpecName('ES6', '#sec-array.prototype', 'Array.prototype')}}</td> - <td>{{Spec2('ES6')}}</td> - <td> </td> - </tr> - </tbody> -</table> - -<h2 id="Browser_compatibility" name="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" name="See_also">See also</h2> - -<ul> - <li>{{jsxref("Array")}}</li> - <li>{{jsxref("Function.prototype")}}</li> -</ul> diff --git a/files/it/web/javascript/reference/global_objects/object/prototype/index.html b/files/it/web/javascript/reference/global_objects/object/prototype/index.html deleted file mode 100644 index 568165d0be..0000000000 --- a/files/it/web/javascript/reference/global_objects/object/prototype/index.html +++ /dev/null @@ -1,215 +0,0 @@ ---- -title: Object.prototype -slug: Web/JavaScript/Reference/Global_Objects/Object/prototype -translation_of: Web/JavaScript/Reference/Global_Objects/Object -translation_of_original: Web/JavaScript/Reference/Global_Objects/Object/prototype ---- -<div>{{JSRef("Global_Objects", "Object")}}</div> - -<h2 id="Summary" name="Summary">Sommario</h2> - -<p>La proprietà <strong><code>Object.prototype</code></strong> rappresenta l'oggetto prototipo di {{jsxref("Global_Objects/Object", "Object")}}.</p> - -<p>{{js_property_attributes(0, 0, 0)}}</p> - -<h2 id="Description" name="Description">Descrizione</h2> - -<p>In JavaScript, tutti gli oggetti sono discendenti di {{jsxref("Global_Objects/Object", "Object")}}; tutti gli oggetti ereditano metodi e proprietà di <code>Object.prototype</code> (tranne nel caso l'oggetto abbia il prototipo uguale a {{jsxref("Global_Objects/null", "null")}}, quindi creati con il metodo {{jsxref("Object.create", "Object.create(null)")}}), anche se questi possono essere sovrascritti. Per esempio, i prototipi degli altri costruttori sovrascrivono la proprietà <code>constructor</code> e forniscono un loro metodo {{jsxref("Object.prototype.toString", "toString()")}}. I cambiamenti al prototipo di Object vengono estesi a tutti gli oggetti, eccetto quelli che sovrascrivono le proprietà e i metodi cambiati.</p> - -<h2 id="Properties" name="Properties">Proprietà</h2> - -<dl> - <dt>{{jsxref("Object.prototype.constructor")}}</dt> - <dd>Specifica la funzione che ha creato l'oggetto a partire dal prototipo.</dd> - <dt>{{jsxref("Object.prototype.__proto__")}} {{non-standard_inline}}</dt> - <dd>È un riferimento all'oggetto usato come prototipo quando l'oggetto è stato istanziato.</dd> - <dt>{{jsxref("Object.prototype.__noSuchMethod__")}} {{non-standard_inline}}</dt> - <dd>Permette di definire una funzione che venga chiamata quando viene chiamato un metodo non definito.</dd> - <dt><s class="obsoleteElement">{{jsxref("Object.prototype.__count__")}} {{obsolete_inline}}</s></dt> - <dd><s class="obsoleteElement">Rappresenta il numero di proprietà persenti in un oggetto, ma è stato rimosso.</s></dd> - <dt><s class="obsoleteElement">{{jsxref("Object.prototype.__parent__")}} {{obsolete_inline}}</s></dt> - <dd><s class="obsoleteElement">Rappresenta il contesto di un oggetto, ma è stato rimosso.</s></dd> -</dl> - -<h2 id="Methods" name="Methods">Metodi</h2> - -<dl> - <dt>{{jsxref("Object.prototype.__defineGetter__()")}} {{non-standard_inline}} {{deprecated_inline}}</dt> - <dd>Associa una funzione a una proprietà di un oggetto. Quando si tenta di leggere il valore di tale proprietà, viene eseguita la funzione e restituito il valore che restituisce.</dd> - <dt>{{jsxref("Object.prototype.__defineSetter__()")}} {{non-standard_inline}} {{deprecated_inline}}</dt> - <dd>Associa una funzione a una proprietà di un oggetto. Quando si tenta di cambiare il valore di tale proprietà, viene eseguita la funzione.</dd> - <dt>{{jsxref("Object.prototype.__lookupGetter__()")}} {{non-standard_inline}} {{deprecated_inline}}</dt> - <dd>Restituisce la funzione definita tramite {{jsxref("Object.prototype.defineGetter", "__defineGetter__()")}}.</dd> - <dt>{{jsxref("Object.prototype.__lookupSetter__()")}} {{non-standard_inline}} {{deprecated_inline}}</dt> - <dd>Restituisce la funzione definita tramite {{jsxref("Object.prototype.defineSetter", "__defineSetter__()")}}.</dd> - <dt>{{jsxref("Object.prototype.hasOwnProperty()")}}</dt> - <dd>Determina se l'oggetto contiene direttamente una proprietà (non ereditata tramite il prototipo).</dd> - <dt>{{jsxref("Object.prototype.isPrototypeOf()")}}</dt> - <dd>Determina se un oggetto fa parte della catena dei prototipi dell'oggetto sul quale è richiamato questo metodo.</dd> - <dt>{{jsxref("Object.prototype.propertyIsEnumerable()")}}</dt> - <dd>Determina se l'<a href="/it/docs/ECMAScript_DontEnum_attribute" title="ECMAScript_DontEnum_attribute">attributo DontEnum di ECMAScript</a> interno è presente.</dd> - <dt>{{jsxref("Object.prototype.toSource()")}} {{non-standard_inline}}</dt> - <dd>Restituisce una stringa contenente il codice sorgente di un oggetto rappresentante l'oggetto sul quale questo metodo viene richiamato; puoi usare questo valore per creare un nuovo oggetto.</dd> - <dt>{{jsxref("Object.prototype.toLocaleString()")}}</dt> - <dd>Richiama {{jsxref("Object.prototype.toString", "toString()")}}.</dd> - <dt>{{jsxref("Object.prototype.toString()")}}</dt> - <dd>Restituisce la rappresentazione dell'oggetto sotto forma di stringa.</dd> - <dt>{{jsxref("Object.prototype.unwatch()")}} {{non-standard_inline}}</dt> - <dd>Termina di osservare i cambiamenti di una proprietà dell'oggetto.</dd> - <dt>{{jsxref("Object.prototype.valueOf()")}}</dt> - <dd>Ritorna il valore primitivo dell'oggetto.</dd> - <dt>{{jsxref("Object.prototype.watch()")}} {{non-standard_inline}}</dt> - <dd>Inizia a osservare i cambiamenti di una proprietà di un oggetto.</dd> - <dt><s class="obsoleteElement">{{jsxref("Object.prototype.eval()")}} {{obsolete_inline}}</s></dt> - <dd><s class="obsoleteElement">Esegue una stringa di codice JavaScript nel contesto dell'oggetto, ma è stato rimosso.</s></dd> -</dl> - -<h2 id="Examples" name="Examples">Esempi</h2> - -<p>Siccome in JavaScript gli oggetti non sono sub-classabili in modo "standard", il prototipo è una soluzione utile per creare un oggetto che funzioni da "classe di base" che contenga dei metodi comuni a più oggetti. Per esempio:</p> - -<pre class="brush: js">var Persona = function() { - this.saParlare = true; -}; - -Persona.prototype.saluta = function() { - if (this.saParlare) { - console.log('Ciao, mi chiamo ' + this.nome); - } -}; - -var Dipendente = function(nome, titolo) { - Persona.call(this); - this.nome = nome; - this.titolo = titolo; -}; - -Dipendente.prototype = Object.create(Persona.prototype); -Dipendente.prototype.constructor = Dipendente; - -Dipendente.prototype.saluta = function() { - if (this.saParlare) { - console.log('Ciao mi chiamo ' + this.nome + ' e lavoro come ' + this.titolo); - } -}; - -var Cliente = function(nome) { - Persona.call(this); - this.nome = nome; -}; - -Cliente.prototype = Object.create(Persona.prototype); -Cliente.prototype.constructor = Cliente; - -var Mimo = function(nome) { - Persona.call(this); - this.nome = nome; - this.saParlare = false; -}; - -Mimo.prototype = Object.create(Persona.prototype); -Mimo.prototype.constructor = Mimo; - -var bob = new Dipendente('Bob', 'Architetto'); -var joe = new Cliente('Joe'); -var rg = new Dipendente('Red Green', 'Tuttofare'); -var mike = new Cliente('Mike'); -var mime = new Mimo('Mimo'); -bob.saluta(); -joe.saluta(); -rg.saluta(); -mike.saluta(); -mime.saluta(); -</pre> - -<p>Stamperà:</p> - -<pre>Ciao, mi chiamo Bob e lavoro come Architetto -Ciao, mi chiamo Joe -Ciao, mi chiamo Red Green, e lavoro come Tuttofare -Ciao, mi chiamo Mike</pre> - -<h2 id="Specifications" name="Specifications">Specifiche</h2> - -<table class="standard-table"> - <tbody> - <tr> - <th scope="col">Specifica</th> - <th scope="col">Stato</th> - <th scope="col">Commenti</th> - </tr> - <tr> - <td>ECMAScript 1st Edition. Implemented in JavaScript 1.0.</td> - <td>Standard</td> - <td>Definizione iniziale.</td> - </tr> - <tr> - <td>{{SpecName('ES5.1', '#sec-15.2.3.1', 'Object.prototype')}}</td> - <td>{{Spec2('ES5.1')}}</td> - <td> </td> - </tr> - <tr> - <td>{{SpecName('ES6', '#sec-object.prototype', 'Object.prototype')}}</td> - <td>{{Spec2('ES6')}}</td> - <td> </td> - </tr> - </tbody> -</table> - -<h2 id="Browser_compatibility" name="Browser_compatibility">Compatibilità con i browser</h2> - -<div>{{CompatibilityTable}}</div> - -<div id="compat-desktop"> -<table class="compat-table"> - <tbody> - <tr> - <th>Funzionalità</th> - <th>Chrome</th> - <th>Firefox (Gecko)</th> - <th>Internet Explorer</th> - <th>Opera</th> - <th>Safari</th> - </tr> - <tr> - <td>Supporto di base</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><span style="font-family: open sans light,sans-serif; font-size: 16px; line-height: 16px;">Funzionalità</span></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><span style="font-size: 12px; line-height: 18px;">Supporto di base</span></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><a href="/it/docs/Web/JavaScript/Introduction_to_Object-Oriented_JavaScript">Introduzione alla programmazione JavaScript orientata agli oggetti</a></li> -</ul> diff --git a/files/it/web/javascript/reference/global_objects/proxy/handler/apply/index.html b/files/it/web/javascript/reference/global_objects/proxy/proxy/apply/index.html index f803b41255..f803b41255 100644 --- a/files/it/web/javascript/reference/global_objects/proxy/handler/apply/index.html +++ b/files/it/web/javascript/reference/global_objects/proxy/proxy/apply/index.html diff --git a/files/it/web/javascript/reference/global_objects/proxy/handler/index.html b/files/it/web/javascript/reference/global_objects/proxy/proxy/index.html index 2be6abb116..2be6abb116 100644 --- a/files/it/web/javascript/reference/global_objects/proxy/handler/index.html +++ b/files/it/web/javascript/reference/global_objects/proxy/proxy/index.html diff --git a/files/it/web/javascript/reference/global_objects/proxy/revocabile/index.html b/files/it/web/javascript/reference/global_objects/proxy/revocable/index.html index bf87d7e3e7..bf87d7e3e7 100644 --- a/files/it/web/javascript/reference/global_objects/proxy/revocabile/index.html +++ b/files/it/web/javascript/reference/global_objects/proxy/revocable/index.html diff --git a/files/it/web/javascript/reference/global_objects/string/prototype/index.html b/files/it/web/javascript/reference/global_objects/string/prototype/index.html deleted file mode 100644 index c83cec2a54..0000000000 --- a/files/it/web/javascript/reference/global_objects/string/prototype/index.html +++ /dev/null @@ -1,179 +0,0 @@ ---- -title: String.prototype -slug: Web/JavaScript/Reference/Global_Objects/String/prototype -translation_of: Web/JavaScript/Reference/Global_Objects/String -translation_of_original: Web/JavaScript/Reference/Global_Objects/String/prototype ---- -<div>{{JSRef}}</div> - -<p>La proprietà <strong><code>String.prototype</code></strong>rappresenta l'oggetto prototipo {{jsxref("String")}}.</p> - -<div>{{js_property_attributes(0, 0, 0)}}</div> - -<h2 id="Description">Description</h2> - -<p>Tutte le istanze {{jsxref("String")}} ereditano da <code>String.prototype</code> . Le modifiche all'oggetto prototipo <code>String</code> vengono propagate a tutte le istanze {{jsxref("String")}}.</p> - -<h2 id="Properties">Properties</h2> - -<dl> - <dt><code>String.prototype.constructor</code></dt> - <dd>Specifica la funzione che crea il prototipo di un oggetto.</dd> - <dt>{{jsxref("String.prototype.length")}}</dt> - <dd>Riflette la lunghezza della stringa.</dd> - <dt><code><em>N</em></code></dt> - <dd>Utilizzato per accedere al carattere in <em>N</em> posizione in cui <em>N</em> è un numero intero positivo compreso tra 0 e uno inferiore al valore della {{jsxref("String.length", "length")}}. Queste proprietà sono di sola lettura.</dd> -</dl> - -<h2 id="Metodi">Metodi</h2> - -<h3 id="Metodi_non_correlati_HTML">Metodi non correlati HTML</h3> - -<dl> - <dt>{{jsxref("String.prototype.charAt()")}}</dt> - <dd>Restituisce il carattere (esattamente un'unità di codice UTF-16) all'indice specificato</dd> - <dt>{{jsxref("String.prototype.charCodeAt()")}}</dt> - <dd>Restituisce un numero che corrisponde al valore dell'unità di codice UTF-16 nell'indice specificato.</dd> - <dt>{{jsxref("String.prototype.codePointAt()")}}</dt> - <dd>Restituisce un numero intero non negativo <strong>Numero</strong> che è il valore del punto di codice codificato UTF-16 che inizia con l'indice specificato.</dd> - <dt>{{jsxref("String.prototype.concat()")}}</dt> - <dd>Combina il testo di due stringhe e restituisce una nuova stringa.</dd> - <dt>{{jsxref("String.prototype.includes()")}}</dt> - <dd>Determina se una stringa può essere trovata all'interno di un'altra stringa.</dd> - <dt>{{jsxref("String.prototype.endsWith()")}}</dt> - <dd>Determina se una stringa termina con i caratteri di un'altra stringa.</dd> - <dt>{{jsxref("String.prototype.indexOf()")}}</dt> - <dd>Restituisce l'indice all'interno dell'oggetto {{jsxref("String")}} chiamante della prima occorrenza del valore specificato o -1 se non trovato.</dd> - <dt>{{jsxref("String.prototype.lastIndexOf()")}}</dt> - <dd>Restituisce l'indice all'interno dell'oggetto {{jsxref("String")}} chiamante della prima occorrenza del valore specificato o -1 se non trovato.</dd> - <dt>{{jsxref("String.prototype.localeCompare()")}}</dt> - <dd>Restituisce un numero che indica se una stringa di riferimento viene prima o dopo o è uguale alla stringa specificata in ordine di ordinamento.</dd> - <dt>{{jsxref("String.prototype.match()")}}</dt> - <dd>Utilizzato per abbinare un'espressione regolare a una stringa.</dd> - <dt>{{jsxref("String.prototype.normalize()")}}</dt> - <dd>Restituisce il modulo di normalizzazione Unicode del valore della stringa chiamante.</dd> - <dt>{{jsxref("String.prototype.padEnd()")}}</dt> - <dd>Riempie la stringa corrente dalla fine con una determinata stringa per creare una nuova stringa di una determinata lunghezza.</dd> - <dt>{{jsxref("String.prototype.padStart()")}}</dt> - <dd>Riempie la stringa corrente dall'inizio con una determinata stringa per creare una nuova stringa da una determinata lunghezza.</dd> - <dt><s class="obsoleteElement">{{jsxref("String.prototype.quote()")}} {{obsolete_inline}}</s></dt> - <dd><s class="obsoleteElement">Avvolge la stringa tra virgolette ("<code>"</code>").</s></dd> - <dt>{{jsxref("String.prototype.repeat()")}}</dt> - <dd>Restituisce una stringa composta da elementi dell'oggetto ripetuti i tempi indicati.</dd> - <dt>{{jsxref("String.prototype.replace()")}}</dt> - <dd>Utilizzato per trovare una corrispondenza tra un'espressione regolare e una stringa e per sostituire la sottostringa con corrispondenza con una nuova sottostringa.</dd> - <dt>{{jsxref("String.prototype.search()")}}</dt> - <dd>Esegue la ricerca di una corrispondenza tra un'espressione regolare e una stringa specificata.</dd> - <dt>{{jsxref("String.prototype.slice()")}}</dt> - <dd>Estrae una sezione di una stringa e restituisce una nuova stringa.</dd> - <dt>{{jsxref("String.prototype.split()")}}</dt> - <dd>Divide un oggetto {{jsxref("Global_Objects/String", "String")}} in una matrice di stringhe separando la stringa in sottostringhe.</dd> - <dt>{{jsxref("String.prototype.startsWith()")}}</dt> - <dd>Determina se una stringa inizia con i caratteri di un'altra stringa.</dd> - <dt>{{jsxref("String.prototype.substr()")}} {{deprecated_inline}}</dt> - <dd>Restituisce i caratteri in una stringa che inizia nella posizione specificata attraverso il numero specificato di caratteri.</dd> - <dt>{{jsxref("String.prototype.substring()")}}</dt> - <dd>Restituisce i caratteri in una stringa tra due indici nella stringa.</dd> - <dt>{{jsxref("String.prototype.toLocaleLowerCase()")}}</dt> - <dd>I caratteri all'interno di una stringa vengono convertiti in minuscolo rispettando le impostazioni locali correnti. Per la maggior parte delle lingue, questo restituirà lo stesso di {{jsxref("String.prototype.toLowerCase()", "toLowerCase()")}}.</dd> - <dt>{{jsxref("String.prototype.toLocaleUpperCase()")}}</dt> - <dd>I caratteri all'interno di una stringa vengono convertiti in maiuscolo rispettando le impostazioni locali correnti. Per la maggior parte delle lingue, ciò restituirà lo stesso di {{jsxref("String.prototype.toUpperCase()", "toUpperCase()")}}.</dd> - <dt>{{jsxref("String.prototype.toLowerCase()")}}</dt> - <dd>Restituisce il valore della stringa chiamante convertito in minuscolo.</dd> - <dt>{{jsxref("String.prototype.toSource()")}} {{non-standard_inline}}</dt> - <dd>Restituisce un oggetto letterale che rappresenta l'oggetto specificato; puoi usare questo valore per creare un nuovo oggetto. Sostituisce il metodo {{jsxref("Object.prototype.toSource()")}} method.</dd> - <dt>{{jsxref("String.prototype.toString()")}}</dt> - <dd>Restituisce una stringa che rappresenta l'oggetto specificato. Sostituisce il metodo {{jsxref("Object.prototype.toString()")}} .</dd> - <dt>{{jsxref("String.prototype.toUpperCase()")}}</dt> - <dd>Restituisce il valore della stringa chiamante convertito in maiuscolo.</dd> - <dt>{{jsxref("String.prototype.trim()")}}</dt> - <dd>Taglia gli spazi bianchi all'inizio e alla fine della stringa. Parte dello standard ECMAScript 5.</dd> - <dt>{{jsxref("String.prototype.trimStart()")}}<br> - {{jsxref("String.prototype.trimLeft()")}}</dt> - <dd>Taglia gli spazi bianchi dall'inizio della stringa.</dd> - <dt>{{jsxref("String.prototype.trimEnd()")}}<br> - {{jsxref("String.prototype.trimRight()")}}</dt> - <dd>Taglia gli spazi bianchi dalla fine della stringa.</dd> - <dt>{{jsxref("String.prototype.valueOf()")}}</dt> - <dd>Restituisce il valore primitivo dell'oggetto specificato. Sostituisce il metodo {{jsxref("Object.prototype.valueOf()")}}.</dd> - <dt>{{jsxref("String.prototype.@@iterator()", "String.prototype[@@iterator]()")}}</dt> - <dd>Restituisce un nuovo oggetto <code>Iterator</code> che itera sopra i punti di codice di un valore String, restituendo ogni punto di codice come valore String.</dd> -</dl> - -<h3 id="HTML_metodi_wrapper_(involucro)">HTML metodi wrapper (involucro)</h3> - -<p>Questi metodi sono di uso limitato, in quanto forniscono solo un sottoinsieme dei tag e degli attributi HTML disponibili.</p> - -<dl> - <dt>{{jsxref("String.prototype.anchor()")}} {{deprecated_inline}}</dt> - <dd>{{htmlattrxref("name", "a", "<a name=\"name\">")}} (hypertext target)</dd> - <dt>{{jsxref("String.prototype.big()")}} {{deprecated_inline}}</dt> - <dd>{{HTMLElement("big")}}</dd> - <dt>{{jsxref("String.prototype.blink()")}} {{deprecated_inline}}</dt> - <dd>{{HTMLElement("blink")}}</dd> - <dt>{{jsxref("String.prototype.bold()")}} {{deprecated_inline}}</dt> - <dd>{{HTMLElement("b")}}</dd> - <dt>{{jsxref("String.prototype.fixed()")}} {{deprecated_inline}}</dt> - <dd>{{HTMLElement("tt")}}</dd> - <dt>{{jsxref("String.prototype.fontcolor()")}} {{deprecated_inline}}</dt> - <dd>{{htmlattrxref("color", "font", "<font color=\"color\">")}}</dd> - <dt>{{jsxref("String.prototype.fontsize()")}} {{deprecated_inline}}</dt> - <dd>{{htmlattrxref("size", "font", "<font size=\"size\">")}}</dd> - <dt>{{jsxref("String.prototype.italics()")}} {{deprecated_inline}}</dt> - <dd>{{HTMLElement("i")}}</dd> - <dt>{{jsxref("String.prototype.link()")}} {{deprecated_inline}}</dt> - <dd>{{htmlattrxref("href", "a", "<a href=\"url\">")}} (link to URL)</dd> - <dt>{{jsxref("String.prototype.small()")}} {{deprecated_inline}}</dt> - <dd>{{HTMLElement("small")}}</dd> - <dt>{{jsxref("String.prototype.strike()")}} {{deprecated_inline}}</dt> - <dd>{{HTMLElement("strike")}}</dd> - <dt>{{jsxref("String.prototype.sub()")}} {{deprecated_inline}}</dt> - <dd>{{HTMLElement("sub")}}</dd> - <dt>{{jsxref("String.prototype.sup()")}} {{deprecated_inline}}</dt> - <dd>{{HTMLElement("sup")}}</dd> -</dl> - -<h2 id="Specificazioni">Specificazioni</h2> - -<table class="standard-table"> - <tbody> - <tr> - <th scope="col">Specificazioni</th> - <th scope="col">Stato</th> - <th scope="col">Commento</th> - </tr> - <tr> - <td>{{SpecName('ES1')}}</td> - <td>{{Spec2('ES1')}}</td> - <td>Definizione iniziale.</td> - </tr> - <tr> - <td>{{SpecName('ES5.1', '#sec-15.5.3.1', 'String.prototype')}}</td> - <td>{{Spec2('ES5.1')}}</td> - <td> </td> - </tr> - <tr> - <td>{{SpecName('ES6', '#sec-string.prototype', 'String.prototype')}}</td> - <td>{{Spec2('ES6')}}</td> - <td> </td> - </tr> - <tr> - <td>{{SpecName('ESDraft', '#sec-string.prototype', 'String.prototype')}}</td> - <td>{{Spec2('ESDraft')}}</td> - <td> </td> - </tr> - </tbody> -</table> - -<h2 id="Compatibilità_con_il_browser">Compatibilità con il browser</h2> - -<p class="hidden"> tabella di compatibilità in questa pagina è generata da dati strutturati. Se desideri contribuire ai dati, consulta <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> e inviaci una richiesta di pull.</p> - -<p>{{Compat("javascript.builtins.String.prototype")}}</p> - -<h2 id="Guarda_anche">Guarda anche</h2> - -<ul> - <li>{{jsxref("String")}}</li> - <li>{{jsxref("Function.prototype")}}</li> -</ul> diff --git a/files/it/web/javascript/reference/operators/operatore_virgola/index.html b/files/it/web/javascript/reference/operators/comma_operator/index.html index e4027930a1..e4027930a1 100644 --- a/files/it/web/javascript/reference/operators/operatore_virgola/index.html +++ b/files/it/web/javascript/reference/operators/comma_operator/index.html diff --git a/files/it/web/javascript/reference/operators/operator_condizionale/index.html b/files/it/web/javascript/reference/operators/conditional_operator/index.html index 1ade61b085..1ade61b085 100644 --- a/files/it/web/javascript/reference/operators/operator_condizionale/index.html +++ b/files/it/web/javascript/reference/operators/conditional_operator/index.html diff --git a/files/it/web/javascript/reference/operators/operatori_aritmetici/index.html b/files/it/web/javascript/reference/operators/operatori_aritmetici/index.html deleted file mode 100644 index e49fe045ae..0000000000 --- a/files/it/web/javascript/reference/operators/operatori_aritmetici/index.html +++ /dev/null @@ -1,292 +0,0 @@ ---- -title: Operatori Aritmetici -slug: Web/JavaScript/Reference/Operators/Operatori_Aritmetici -tags: - - JavaScript - - Operatori - - Operatori Aritmetici -translation_of: Web/JavaScript/Reference/Operators -translation_of_original: Web/JavaScript/Reference/Operators/Arithmetic_Operators ---- -<div>{{jsSidebar("Operators")}}</div> - -<div>Gli <strong>operatori aritmetici</strong> lavorano su operandi numerici (sia letterali che variabili) e ritornano un singolo valore numerico. Gli operatori aritmetici standard sono l'addizione (+), la sottrazione (-), la moltiplicazione (*) e la divisione (/).</div> - -<h2 id="Addizione_()"><a name="Addition">Addizione (+)</a></h2> - -<p>L'operazione di addizione produce la somma di operandi numerici o la concatenzione di stringhe.</p> - -<h3 id="Sintassi">Sintassi</h3> - -<pre class="syntaxbox"><strong>Operatore:</strong> x + y -</pre> - -<h3 id="Esempi">Esempi</h3> - -<pre class="brush: js">// Numero + Numero -> addizione -1 + 2 // 3 - -// Booleano + Numero -> addizione -true + 1 // 2 - -// Booleano + Booleano -> additione -false + false // 0 - -// Numero + Stringa -> concatenazione -5 + "foo" // "5foo" - -// Stringa + Booleano -> concatenazione -"foo" + false // "foofalse" - -// Stringa + Stringa -> concatenazione -"foo" + "bar" // "foobar" -</pre> - -<h2 id="Sottrazione_(-)"><a name="Subtraction">Sottrazione (-)</a></h2> - -<p>L'operatore di sottrazione fa la sottrazione dei due operandi e produce la loro differenza.</p> - -<h3 id="Sintassi_2">Sintassi</h3> - -<pre class="syntaxbox"><strong>Operatore:</strong> x - y -</pre> - -<h3 id="Esempi_2">Esempi</h3> - -<pre class="brush: js">5 - 3 // 2 -3 - 5 // -2 -"foo" - 3 // NaN</pre> - -<h2 id="Divisione_()"><a name="Division">Divisione (/)</a></h2> - -<p>L'operatore di divisione produce il quoziente dei suoi operandi dove l'operando di sinistra è il dividendo e l'operando di destra è il divisore.</p> - -<h3 id="Sintassi_3">Sintassi</h3> - -<pre class="syntaxbox"><strong>Operatore:</strong> x / y -</pre> - -<h3 id="Esempi_3">Esempi</h3> - -<pre class="brush: js">1 / 2 // restituisce 0.5 in JavaScript -1 / 2 // restituisce 0 in Java -// (nessuno degli operandi è un numero in virgola mobile esplicito) - -1.0 / 2.0 // restituisce 0.5 in both JavaScript and Java - -2.0 / 0 // restituisce Infinity in JavaScript -2.0 / 0.0 // restituisce Infinity too -2.0 / -0.0 // restituisce -Infinity in JavaScript</pre> - -<h2 id="Moltiplicazione_(*)"><a name="Multiplication">Moltiplicazione (*)</a></h2> - -<p>The multiplication operator produces the product of the operands.</p> - -<h3 id="Sintassi_4">Sintassi</h3> - -<pre class="syntaxbox"><strong>Operatore:</strong> x * y -</pre> - -<h3 id="Esempi_4">Esempi</h3> - -<pre class="brush: js">2 * 2 // 4 --2 * 2 // -4 -Infinity * 0 // NaN -Infinity * Infinity // Infinity -"foo" * 2 // NaN -</pre> - -<h2 id="Resto_()"><a name="Remainder">Resto (%)</a></h2> - -<p>L'operatore Resto o Modulo restituisce il “resto“ rimasto quando un operando viene diviso per un secondo operando. Calcola il resto della divisione fra il primo e il secondo operando. Porta sempre il segno del dividendo.</p> - -<h3 id="Sintassi_5">Sintassi</h3> - -<pre class="syntaxbox"><strong>Operatore:</strong> var1 % var2 -</pre> - -<h3 id="Esempi_5">Esempi</h3> - -<pre class="brush: js">12 % 5 // 2 --1 % 2 // -1 -NaN % 2 // NaN -1 % 2 // 1 -2 % 3 // 2 --4 % 2 // -0 -</pre> - -<h2 id="Esponente_(**)"><a name="Exponentiation">Esponente (**)</a></h2> - -<p><strong>L'operatore Esponente o esponenziale in JavaScript. </strong>Una delle funzionalità di questa versione è l'operatore di esponenziazione. Esponente restituisce il risultato dell'elevamento a potenza dal primo operando al secondo. Cioè <code>var1</code> <code>var2</code> , <code>var2.</code> <code>var1</code>e <code>var2</code> sono variabili. L'operatore Esponente ha ragione associativa. <code>a ** b ** c</code> equivale a <code>a ** (b ** c)</code>.</p> - -<h3 id="Sintassi_6">Sintassi</h3> - -<pre class="syntaxbox"><strong>Operatore:</strong> var1 ** var2 -</pre> - -<h3 id="Note">Note</h3> - -<p>Nella maggior parte dei linguaggi come PHP e Python e altri che usano l'operatore Esponente (**), ha precedenza rispetto agli altri operatori unari come + e -, salvo in alcune eccezioni. Ad esempio, in Bash l'operatore ** ha una minor importanza rispetto agli operatori unari. In JavaScript, è impossibile scrivere un'espressione Esponente ambigua, ovvero non è possibile inserire un operatore unario ( <code>+/-/~/!/delete/void/typeof</code> ) immediatamente prima del numero di base. Il calcolo della potenza può essere espresso più sinteticamente usando la notazione infissa. Simile ad altri linguaggi come Python o F#, <code>**</code> è usato per indicare l'operatore. </p> - -<pre class="brush: js">-2 ** 2 // equals 4 in ES2016 or in Bash, equals -4 in other languages.</pre> - -<p>Accetta base sul lato sinistro ed esponente sul lato destro, rispettivamente.</p> - -<pre class="brush: js">let value = 5; value **= 2; // value: 25 -</pre> - -<h3 id="Esempi_6">Esempi</h3> - -<pre class="brush: js">2 ** 3 // 8 -3 ** 2 // 9 -3 ** 2.5 // 15.588457268119896 -10 ** -1 // 0.1 -NaN ** 2 // NaN - -2 ** 3 ** 2 // 512 -2 ** (3 ** 2) // 512 -(2 ** 3) ** 2 // 64 - -var a = 3; -var b = a ** 3; -alert("3x3x3 is = " + b); // 27 -</pre> - -<p>Per invertire il segno del risultato di un'espressione di Esponente:</p> - -<pre><code>-(2 ** 2) // -4</code> -</pre> - -<p>Per forzare la base di un'espressione di Esponente ad essere un numero negativo:</p> - -<pre><code>(-2) ** 2 // 4 </code></pre> - -<h2 id="Incremento_()"><a name="Increment">Incremento (++)</a></h2> - -<p>L'operatore di incremento incrementa (aggiunge uno a) il suo operando e restituisce un valore.</p> - -<ul> - <li>Se usato in post posizione, con operatore dopo operando (ad esempio, x ++), restituisce il valore prima di incrementare.</li> - <li>Se usato come prefisso quindi prima dell'operando (ad esempio, ++ x), restituisce il valore dopo l'incremento.</li> -</ul> - -<h3 id="Sintassi_7">Sintassi</h3> - -<pre class="syntaxbox"><strong>Operatore:</strong> x++ or ++x -</pre> - -<h3 id="Esempi_7">Esempi</h3> - -<pre class="brush: js">// Postfix // post posizione -var x = 3; -y = x++; // y = 3, x = 4 - -// Prefix // Prefisso -var a = 2; -b = ++a; // a = 3, b = 3 -</pre> - -<h2 id="Decremento_(--)"><a name="Decrement">Decremento (--)</a></h2> - -<p>L'operatore decrementa decrementa (sottrae uno da) il suo operando e restituisce un valore.</p> - -<ul> - <li>Se usato in post posizione (ad esempio x--), restituisce il valore prima di decrementare.</li> - <li>Se usato come prefisso (ad esempio, --x), restituisce il valore dopo la decrementazione.</li> -</ul> - -<h3 id="Sintassi_8">Sintassi</h3> - -<pre class="syntaxbox"><strong>Operatore:</strong> x-- or --x -</pre> - -<h3 id="Esempi_8">Esempi</h3> - -<pre class="brush: js">// Postfix // post posizione -var x = 3; -y = x--; // y = 3, x = 2 - -// Prefix // Prefisso -var a = 2; -b = --a; // a = 1, b = 1 -</pre> - -<h2 id="Negazione_unaria_(-)"><a name="Unary_negation">Negazione unaria (-)</a></h2> - -<p>L'operatore di negazione unario precede il suo operando e lo nega.</p> - -<h3 id="Sintassi_9">Sintassi</h3> - -<pre class="syntaxbox"><strong>Operatore:</strong> -x -</pre> - -<h3 id="Esempi_9">Esempi</h3> - -<pre><code>var x = 3; -y = -x; // y = -3, x = 3 - -//</code>L'operatore di negazione unario può convertire numeri diversi in un numero<code> -var x = "4"; -y = -x; // y = -4</code></pre> - -<h2 id="Unario_più_()"><a name="Unary_plus">Unario più</a> (+)</h2> - -<p>L'operatore unario più precede il suo operando e valuta il suo operando, ma tenta di convertirlo in un numero, se non lo è già. Anche se la negazione unaria (-) può anche convertire non numeri, unario è il modo più veloce e preferito per convertire qualcosa in un numero, perché non esegue altre operazioni sul numero. È in grado di convertire rappresentazioni di stringa di numeri interi e float, oltre ai valori non stringa <code>true</code> , <code>false</code> e <code>null</code> . Sono supportati i numeri interi decimali ed esadecimali ("0x" -prefixed). I numeri negativi sono supportati (sebbene non per hex). Se non può analizzare un valore particolare, valuterà in <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN">NaN</a>.</p> - -<h3 id="Sintassi_10">Sintassi</h3> - -<pre class="syntaxbox"><strong>Operatore:</strong> +x -</pre> - -<h3 id="Esempi_10">Esempi</h3> - -<pre><code>+3 // 3 -+'3' // 3 -+true // 1 -+false // 0 -+null // 0 -+function(val){ return val } // NaN</code></pre> - -<h2 id="Specificazioni">Specificazioni</h2> - -<table class="standard-table"> - <tbody> - <tr> - <th scope="col">Specificazioni</th> - <th scope="col">Stato</th> - <th scope="col">Commento</th> - </tr> - <tr> - <td>ECMAScript 1st Edition.</td> - <td>Standard</td> - <td>Definizione iniziale.</td> - </tr> - <tr> - <td>{{SpecName('ES5.1', '#sec-11.3')}}</td> - <td>{{Spec2('ES5.1')}}</td> - <td>Definito in diverse sezioni della specifica: <a href="http://www.ecma-international.org/ecma-262/5.1/#sec-11.6">Additive operators</a>, <a href="http://www.ecma-international.org/ecma-262/5.1/#sec-11.5">Multiplicative operators</a>, <a href="http://www.ecma-international.org/ecma-262/5.1/#sec-11.3">Postfix expressions</a>, <a href="http://www.ecma-international.org/ecma-262/5.1/#sec-11.4">Unary operators</a>.</td> - </tr> - <tr> - <td>{{SpecName('ES2015', '#sec-postfix-expressions')}}</td> - <td>{{Spec2('ES2015')}}</td> - <td>Definito in diverse sezioni della specifica: <a href="http://www.ecma-international.org/ecma-262/6.0/#sec-additive-operators">Additive operators</a>, <a href="http://www.ecma-international.org/ecma-262/6.0/#sec-multiplicative-operators">Multiplicative operators</a>, <a href="http://www.ecma-international.org/ecma-262/6.0/#sec-postfix-expressions">Postfix expressions</a>, <a href="http://www.ecma-international.org/ecma-262/6.0/#sec-unary-operators">Unary operators</a>.</td> - </tr> - <tr> - <td>{{SpecName('ES2016', '#sec-postfix-expressions')}}</td> - <td>{{Spec2('ES2016')}}</td> - <td>Aggiunto <a href="https://github.com/rwaldron/exponentiation-operator">Exponentiation operator</a>.</td> - </tr> - </tbody> -</table> - -<h2 id="Compatibilità_con_i_browser">Compatibilità con i browser</h2> - - - -<p>{{Compat("javascript.operators.arithmetic")}}</p> - -<h2 id="Guarda_anche">Guarda anche</h2> - -<ul> - <li><a href="/en-US/docs/Web/JavaScript/Reference/Operators/Assignment_Operators">Assignment operators</a></li> -</ul> diff --git a/files/it/web/javascript/reference/template_strings/index.html b/files/it/web/javascript/reference/template_literals/index.html index 5bb4890ad8..5bb4890ad8 100644 --- a/files/it/web/javascript/reference/template_strings/index.html +++ b/files/it/web/javascript/reference/template_literals/index.html |