From da78a9e329e272dedb2400b79a3bdeebff387d47 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:42:17 -0500 Subject: initial commit --- .../global_objects/array/tostring/index.html | 80 ++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 files/it/web/javascript/reference/global_objects/array/tostring/index.html (limited to 'files/it/web/javascript/reference/global_objects/array/tostring/index.html') diff --git a/files/it/web/javascript/reference/global_objects/array/tostring/index.html b/files/it/web/javascript/reference/global_objects/array/tostring/index.html new file mode 100644 index 0000000000..a5b8dcaa1e --- /dev/null +++ b/files/it/web/javascript/reference/global_objects/array/tostring/index.html @@ -0,0 +1,80 @@ +--- +title: Array.prototype.toString() +slug: Web/JavaScript/Reference/Global_Objects/Array/toString +tags: + - Array + - JavaScript + - Prototype + - metodo +translation_of: Web/JavaScript/Reference/Global_Objects/Array/toString +--- +
{{JSRef}}
+ +

Il metodo toString() restituisce una stringa che rappresenta l'array specificato e i suoi elementi.

+ +
{{EmbedInteractiveExample("pages/js/array-tostring.html")}}
+ +

Sintassi

+ +
arr.toString()
+ +

Valore di ritorno

+ +

Una stringa che rappresenta gli elementi dell'array.

+ +

Descrizione

+ +

L'oggetto {{jsxref("Array")}} sovrascrive il metodo toString di {{jsxref("Object")}}. Per gli oggetti Array, il metodo toString unisce l'array e restituisce una stringa contenente ciascun elemento dell'array separato da virgole.

+ +

JavaScript chiama automaticamente il metodo toString quando un array deve essere rappresentato come un valore di testo o quando viene fatto riferimento a un array in una concatenazione di stringhe.

+ +

ECMAScript 5 semantics

+ +

A partire da JavaScript 1.8.5 (Firefox 4) e coerente con la semantica ECMAScript 5th edition, il metodo toString() è generico e può essere utilizzato con qualsiasi oggetto. {{jsxref("Object.prototype.toString()")}} sarà chiamato e verrà restituito il valore risultante.

+ +

Specifiche

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SpecificaStatoCommento
{{SpecName('ES1')}}{{Spec2('ES1')}}Definizione iniziale Implementato in JavaScript 1.1.
{{SpecName('ES5.1', '#sec-15.4.4.2', 'Array.prototype.toString')}}{{Spec2('ES5.1')}} 
{{SpecName('ES6', '#sec-array.prototype.tostring', 'Array.prototype.toString')}}{{Spec2('ES6')}} 
{{SpecName('ESDraft', '#sec-array.prototype.tostring', 'Array.prototype.toString')}}{{Spec2('ESDraft')}} 
+ +

Compatibilità con i browser

+ +
+ + +

{{Compat("javascript.builtins.Array.toString")}}

+
+ +

Vedi anche

+ + -- cgit v1.2.3-54-g00ecf