diff options
Diffstat (limited to 'files/fr/web/javascript/reference/objets_globaux/string/valueof/index.html')
| -rw-r--r-- | files/fr/web/javascript/reference/objets_globaux/string/valueof/index.html | 83 |
1 files changed, 0 insertions, 83 deletions
diff --git a/files/fr/web/javascript/reference/objets_globaux/string/valueof/index.html b/files/fr/web/javascript/reference/objets_globaux/string/valueof/index.html deleted file mode 100644 index 58c9fb66bf..0000000000 --- a/files/fr/web/javascript/reference/objets_globaux/string/valueof/index.html +++ /dev/null @@ -1,83 +0,0 @@ ---- -title: String.prototype.valueOf() -slug: Web/JavaScript/Reference/Objets_globaux/String/valueOf -tags: - - JavaScript - - Méthode - - Prototype - - Reference - - String -translation_of: Web/JavaScript/Reference/Global_Objects/String/valueOf ---- -<div>{{JSRef}}</div> - -<p>La méthode <code><strong>valueOf()</strong></code> renvoie la valeur primitive de l'objet {{jsxref("String")}}.</p> - -<div>{{EmbedInteractiveExample("pages/js/string-valueof.html")}}</div> - -<p class="hidden">Le code source de cet exemple interactif est disponible dans un dépôt GitHub. Si vous souhaitez contribuez à ces exemples, n'hésitez pas à cloner <a href="https://github.com/mdn/interactive-examples">https://github.com/mdn/interactive-examples</a> et à envoyer une <em>pull request</em> !</p> - -<h2 id="Syntaxe">Syntaxe</h2> - -<pre class="syntaxbox"><var>str</var>.valueOf()</pre> - -<h3 id="Valeur_de_retour">Valeur de retour</h3> - -<p>Une chaîne de caractères qui représente la valeur primitive d'un objet {{jsxref("String")}}.</p> - -<h2 id="Description">Description</h2> - -<p>La méthode <code>valueOf()</code> de <code>String</code> renvoie la valeur primitive de l'objet <code>String</code> sous la forme d'une chaine de caractères. Cette valeur est équivalente à {{jsxref("String.prototype.toString()")}}.</p> - -<p>Cette méthode est généralement appelée en interne par JavaScript et non explicitement dans du code.</p> - -<h2 id="Exemples">Exemples</h2> - -<pre class="brush: js">var x = new String("Coucou monde"); -console.log(x.valueOf()); // affiche "Coucou monde" -</pre> - -<h2 id="Spécifications">Spécifications</h2> - -<table class="standard-table"> - <tbody> - <tr> - <th scope="col">Spécification</th> - <th scope="col">État</th> - <th scope="col">Commentaires</th> - </tr> - <tr> - <td>{{SpecName('ES1')}}</td> - <td>{{Spec2('ES1')}}</td> - <td>Définition initiale. Implémentée avec JavaScript 1.1.</td> - </tr> - <tr> - <td>{{SpecName('ES5.1', '#sec-15.5.4.3', 'String.prototype.valueOf')}}</td> - <td>{{Spec2('ES5.1')}}</td> - <td> </td> - </tr> - <tr> - <td>{{SpecName('ES6', '#sec-string.prototype.valueof', 'String.prototype.valueOf')}}</td> - <td>{{Spec2('ES6')}}</td> - <td> </td> - </tr> - <tr> - <td>{{SpecName('ESDraft', '#sec-string.prototype.valueof', 'String.prototype.valueOf')}}</td> - <td>{{Spec2('ESDraft')}}</td> - <td> </td> - </tr> - </tbody> -</table> - -<h2 id="Compatibilité_des_navigateurs">Compatibilité des navigateurs</h2> - -<p class="hidden">Le tableau de compatibilité de cette page a été généré à partir de données structurées. Si vous souhaitez contribuer à ces données, n'hésitez pas à envoyer une <em>pull request</em> sur <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a>.</p> - -<p>{{Compat("javascript.builtins.String.valueOf")}}</p> - -<h2 id="Voir_aussi">Voir aussi</h2> - -<ul> - <li>{{jsxref("String.prototype.toString()")}}</li> - <li>{{jsxref("Object.prototype.valueOf()")}}</li> -</ul> |
