From 844f5103992238c0c23203286dad16a466e89c97 Mon Sep 17 00:00:00 2001 From: julieng Date: Tue, 3 Aug 2021 08:03:09 +0200 Subject: move *.html to *.md --- .../global_objects/string/repeat/index.html | 84 ---------------------- .../global_objects/string/repeat/index.md | 84 ++++++++++++++++++++++ 2 files changed, 84 insertions(+), 84 deletions(-) delete mode 100644 files/fr/web/javascript/reference/global_objects/string/repeat/index.html create mode 100644 files/fr/web/javascript/reference/global_objects/string/repeat/index.md (limited to 'files/fr/web/javascript/reference/global_objects/string/repeat') diff --git a/files/fr/web/javascript/reference/global_objects/string/repeat/index.html b/files/fr/web/javascript/reference/global_objects/string/repeat/index.html deleted file mode 100644 index 77600fdf96..0000000000 --- a/files/fr/web/javascript/reference/global_objects/string/repeat/index.html +++ /dev/null @@ -1,84 +0,0 @@ ---- -title: String.prototype.repeat() -slug: Web/JavaScript/Reference/Global_Objects/String/repeat -tags: - - ECMAScript 2015 - - JavaScript - - Méthode - - Prototype - - Reference - - String - - polyfill -translation_of: Web/JavaScript/Reference/Global_Objects/String/repeat -original_slug: Web/JavaScript/Reference/Objets_globaux/String/repeat ---- -
{{JSRef}}
- -

La méthode repeat() construit et renvoie une nouvelle chaine de caractères qui contient le nombre de copie demandée de la chaine de caractères sur laquelle la méthode a été appelée, concaténées les unes aux autres.

- -
{{EmbedInteractiveExample("pages/js/string-repeat.html")}}
- -

Syntaxe

- -
str.repeat(compte)
- -

Paramètres

- -
-
compte
-
Un nombre entier entre 0 and +∞ : [ 0, +∞[, indiquant le nombre de fois que la chaine de caractères doit être repétée dans la nouvelle chaine de caractères.
-
- -

Valeur de retour

- -

Une nouvelle chaîne de caractères composée du nombre indiqué de copies de la chaîne appelante.

- -

Exceptions

- - - -
-
{{jsxref("RangeError")}}
-
La compteur doit être positif et inférieur à l'infini.
-
- -

Exemples

- -
"abc".repeat(-1)     // RangeError
-"abc".repeat(0)      // ""
-"abc".repeat(1)      // "abc"
-"abc".repeat(2)      // "abcabc"
-"abc".repeat(3.5)    // "abcabcabc" (le compteur est converti en un nombre entier)
-"abc".repeat(1/0)    // RangeError
-
-({toString : () => "abc", repeat : String.prototype.repeat}).repeat(2)
-// "abcabc" (repeat() est une méthode générique)
- -

Spécifications

- - - - - - - - - - - - - - - - - - - -
SpécificationÉtatCommentaire
{{SpecName('ES2015', '#sec-string.prototype.repeat', 'String.prototype.repeat')}}{{Spec2('ES2015')}}Première définition.
{{SpecName('ESDraft', '#sec-string.prototype.repeat', 'String.prototype.repeat')}}{{Spec2('ESDraft')}}
- -

Compatibilité des navigateurs

- -

{{Compat("javascript.builtins.String.repeat")}}

diff --git a/files/fr/web/javascript/reference/global_objects/string/repeat/index.md b/files/fr/web/javascript/reference/global_objects/string/repeat/index.md new file mode 100644 index 0000000000..77600fdf96 --- /dev/null +++ b/files/fr/web/javascript/reference/global_objects/string/repeat/index.md @@ -0,0 +1,84 @@ +--- +title: String.prototype.repeat() +slug: Web/JavaScript/Reference/Global_Objects/String/repeat +tags: + - ECMAScript 2015 + - JavaScript + - Méthode + - Prototype + - Reference + - String + - polyfill +translation_of: Web/JavaScript/Reference/Global_Objects/String/repeat +original_slug: Web/JavaScript/Reference/Objets_globaux/String/repeat +--- +
{{JSRef}}
+ +

La méthode repeat() construit et renvoie une nouvelle chaine de caractères qui contient le nombre de copie demandée de la chaine de caractères sur laquelle la méthode a été appelée, concaténées les unes aux autres.

+ +
{{EmbedInteractiveExample("pages/js/string-repeat.html")}}
+ +

Syntaxe

+ +
str.repeat(compte)
+ +

Paramètres

+ +
+
compte
+
Un nombre entier entre 0 and +∞ : [ 0, +∞[, indiquant le nombre de fois que la chaine de caractères doit être repétée dans la nouvelle chaine de caractères.
+
+ +

Valeur de retour

+ +

Une nouvelle chaîne de caractères composée du nombre indiqué de copies de la chaîne appelante.

+ +

Exceptions

+ + + +
+
{{jsxref("RangeError")}}
+
La compteur doit être positif et inférieur à l'infini.
+
+ +

Exemples

+ +
"abc".repeat(-1)     // RangeError
+"abc".repeat(0)      // ""
+"abc".repeat(1)      // "abc"
+"abc".repeat(2)      // "abcabc"
+"abc".repeat(3.5)    // "abcabcabc" (le compteur est converti en un nombre entier)
+"abc".repeat(1/0)    // RangeError
+
+({toString : () => "abc", repeat : String.prototype.repeat}).repeat(2)
+// "abcabc" (repeat() est une méthode générique)
+ +

Spécifications

+ + + + + + + + + + + + + + + + + + + +
SpécificationÉtatCommentaire
{{SpecName('ES2015', '#sec-string.prototype.repeat', 'String.prototype.repeat')}}{{Spec2('ES2015')}}Première définition.
{{SpecName('ESDraft', '#sec-string.prototype.repeat', 'String.prototype.repeat')}}{{Spec2('ESDraft')}}
+ +

Compatibilité des navigateurs

+ +

{{Compat("javascript.builtins.String.repeat")}}

-- cgit v1.2.3-54-g00ecf