From bf8e099b9c8b3c60d60b3712b4fc97b052c39887 Mon Sep 17 00:00:00 2001 From: julieng Date: Tue, 3 Aug 2021 08:03:23 +0200 Subject: convert content to md --- .../global_objects/array/tostring/index.md | 73 +++++++--------------- 1 file changed, 24 insertions(+), 49 deletions(-) (limited to 'files/fr/web/javascript/reference/global_objects/array/tostring') diff --git a/files/fr/web/javascript/reference/global_objects/array/tostring/index.md b/files/fr/web/javascript/reference/global_objects/array/tostring/index.md index 2c9944f5dd..a14b6b7b8d 100644 --- a/files/fr/web/javascript/reference/global_objects/array/tostring/index.md +++ b/files/fr/web/javascript/reference/global_objects/array/tostring/index.md @@ -10,69 +10,44 @@ tags: translation_of: Web/JavaScript/Reference/Global_Objects/Array/toString original_slug: Web/JavaScript/Reference/Objets_globaux/Array/toString --- -
{{JSRef}}
+{{JSRef}} -

La méthode toString() renvoie une chaine de caractères représentant le tableau spécifié et ses éléments.

+La méthode **`toString()`** renvoie une chaine de caractères représentant le tableau spécifié et ses éléments. -
{{EmbedInteractiveExample("pages/js/array-tostring.html")}}
+{{EmbedInteractiveExample("pages/js/array-tostring.html")}} -

Syntaxe

+## Syntaxe -
arr.toString()
+ arr.toString() -

Valeur de retour

+### Valeur de retour -

Une chaîne de caractères qui représente les éléments du tableau.

+Une chaîne de caractères qui représente les éléments du tableau. -

Description

+## Description -

L'objet {{jsxref("Array")}} redéfinit la méthode toString d'{{jsxref("Object")}}. Pour les objets Array, la méthode toString() concatène les éléments du tableau et renvoie une chaîne contenant chacun des éléments, séparés par des virgules.

+L'objet {{jsxref("Array")}} redéfinit la méthode `toString` d'{{jsxref("Object")}}. Pour les objets `Array`, la méthode `toString()` concatène les éléments du tableau et renvoie une chaîne contenant chacun des éléments, séparés par des virgules. -

JavaScript appelle la méthode toString() automatiquement lorsqu'un tableau doit être représenté par une valeur texte ou lorsqu'on fait référence à un tableau dans une concaténation de chaines de caractères.

+JavaScript appelle la méthode `toString()` automatiquement lorsqu'un tableau doit être représenté par une valeur texte ou lorsqu'on fait référence à un tableau dans une concaténation de chaines de caractères. -

Sémantique d'ECMAScript 5

+### Sémantique d'ECMAScript 5 -

À partir de JavaScript 1.8.5 (Firefox 4), et en cohérence avec la 5e édition d'ECMAScript, la méthode toString() est générique et peut être utilisé avec n'importe quel objet. {{jsxref("Object.prototype.toString()")}} sera appelée, et la valeur résultante sera renvoyée.

+À partir de JavaScript 1.8.5 (Firefox 4), et en cohérence avec la 5e édition d'ECMAScript, la méthode `toString()` est générique et peut être utilisé avec n'importe quel objet. {{jsxref("Object.prototype.toString()")}} sera appelée, et la valeur résultante sera renvoyée. -

Spécifications

+## Spécifications - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SpécificationÉtatCommentaires
{{SpecName('ES1')}}{{Spec2('ES1')}}Définition initiale. Implémentée avec 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')}} 
+| Spécification | État | Commentaires | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------- | ----------------------------------------------------- | +| {{SpecName('ES1')}} | {{Spec2('ES1')}} | Définition initiale. Implémentée avec 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é des navigateurs

+## Compatibilité des navigateurs -

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

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

Voir aussi

+## Voir aussi - +- {{jsxref("Object.prototype.toSource()")}} +- {{jsxref("Array.prototype.join()")}} -- cgit v1.2.3-54-g00ecf