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/touppercase/index.html | 104 --------------------- .../global_objects/string/touppercase/index.md | 104 +++++++++++++++++++++ 2 files changed, 104 insertions(+), 104 deletions(-) delete mode 100644 files/fr/web/javascript/reference/global_objects/string/touppercase/index.html create mode 100644 files/fr/web/javascript/reference/global_objects/string/touppercase/index.md (limited to 'files/fr/web/javascript/reference/global_objects/string/touppercase') diff --git a/files/fr/web/javascript/reference/global_objects/string/touppercase/index.html b/files/fr/web/javascript/reference/global_objects/string/touppercase/index.html deleted file mode 100644 index cd9d6b0f9b..0000000000 --- a/files/fr/web/javascript/reference/global_objects/string/touppercase/index.html +++ /dev/null @@ -1,104 +0,0 @@ ---- -title: String.prototype.toUpperCase() -slug: Web/JavaScript/Reference/Global_Objects/String/toUpperCase -tags: - - JavaScript - - Méthode - - Prototype - - Reference - - String -translation_of: Web/JavaScript/Reference/Global_Objects/String/toUpperCase -original_slug: Web/JavaScript/Reference/Objets_globaux/String/toUpperCase ---- -
{{JSRef}}
- -

La méthode toUpperCase() retourne la valeur de la chaîne courante, convertie en majuscules.

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

Syntaxe

- -
str.toUpperCase()
- -

Valeur de retour

- -

Une nouvelle chaîne de caractères obtenue à partir de la chaîne appelante, passée en majuscules.

- -

Exceptions levées

- -
-
{{jsxref("TypeError")}}
-
Une telle exception sera levée si on appelle cette méthode sur {{jsxref("null")}} ou {{jsxref("undefined")}} (en utilisant Function.prototype.call() par exemple).
-
- -

Description

- -

La méthode toUpperCase() retourne la valeur de la chaîne convertie en majuscules. toUpperCase n'affecte pas la valeur de la chaîne elle-même.

- -

Exemples

- -

Utiliser toUpperCase()

- -
console.log( "alphabet".toUpperCase() ); // "ALPHABET"
- -

Convertir une valeur this en chaîne de caractères

- -

Cette peut être utilisée pour convertir une valeur qui n'est pas une chaîne de caractères lorsque celle-ci est fournie comme valeur this : ​​​​

- -
var obj = {
-  toString: function toString(){
-    return 'abcdef';
-  }
-};
-var a = String.prototype.toUpperCase.call(obj);
-var b = String.prototype.toUpperCase.call(true);
-
-console.log(a); // Affiche 'ABCDEF' dans la console
-console.log(b); // Affiche 'TRUE' dans la console
-
- -

Spécifications

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SpécificationÉtatCommentaires
{{SpecName('ES1')}}{{Spec2('ES1')}}Définition initiale. Implémentée avec JavaScript 1.0.
{{SpecName('ES5.1', '#sec-15.5.4.18', 'String.prototype.toUpperCase')}}{{Spec2('ES5.1')}} 
{{SpecName('ES6', '#sec-string.prototype.touppercase', 'String.prototype.toUpperCase')}}{{Spec2('ES6')}} 
{{SpecName('ESDraft', '#sec-string.prototype.touppercase', 'String.prototype.toUpperCase')}}{{Spec2('ESDraft')}} 
- -

Compatibilité des navigateurs

- -

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

- -

Voir aussi

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

La méthode toUpperCase() retourne la valeur de la chaîne courante, convertie en majuscules.

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

Syntaxe

+ +
str.toUpperCase()
+ +

Valeur de retour

+ +

Une nouvelle chaîne de caractères obtenue à partir de la chaîne appelante, passée en majuscules.

+ +

Exceptions levées

+ +
+
{{jsxref("TypeError")}}
+
Une telle exception sera levée si on appelle cette méthode sur {{jsxref("null")}} ou {{jsxref("undefined")}} (en utilisant Function.prototype.call() par exemple).
+
+ +

Description

+ +

La méthode toUpperCase() retourne la valeur de la chaîne convertie en majuscules. toUpperCase n'affecte pas la valeur de la chaîne elle-même.

+ +

Exemples

+ +

Utiliser toUpperCase()

+ +
console.log( "alphabet".toUpperCase() ); // "ALPHABET"
+ +

Convertir une valeur this en chaîne de caractères

+ +

Cette peut être utilisée pour convertir une valeur qui n'est pas une chaîne de caractères lorsque celle-ci est fournie comme valeur this : ​​​​

+ +
var obj = {
+  toString: function toString(){
+    return 'abcdef';
+  }
+};
+var a = String.prototype.toUpperCase.call(obj);
+var b = String.prototype.toUpperCase.call(true);
+
+console.log(a); // Affiche 'ABCDEF' dans la console
+console.log(b); // Affiche 'TRUE' dans la console
+
+ +

Spécifications

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SpécificationÉtatCommentaires
{{SpecName('ES1')}}{{Spec2('ES1')}}Définition initiale. Implémentée avec JavaScript 1.0.
{{SpecName('ES5.1', '#sec-15.5.4.18', 'String.prototype.toUpperCase')}}{{Spec2('ES5.1')}} 
{{SpecName('ES6', '#sec-string.prototype.touppercase', 'String.prototype.toUpperCase')}}{{Spec2('ES6')}} 
{{SpecName('ESDraft', '#sec-string.prototype.touppercase', 'String.prototype.toUpperCase')}}{{Spec2('ESDraft')}} 
+ +

Compatibilité des navigateurs

+ +

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

+ +

Voir aussi

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