diff options
author | julieng <julien.gattelier@gmail.com> | 2021-08-03 08:03:09 +0200 |
---|---|---|
committer | SphinxKnight <SphinxKnight@users.noreply.github.com> | 2021-09-03 08:08:25 +0200 |
commit | 844f5103992238c0c23203286dad16a466e89c97 (patch) | |
tree | d537708951bb2b61be8192ffacc05a0ce6804f89 /files/fr/web/javascript/reference/statements/do...while/index.html | |
parent | a70fd5b73ecb10bec3906640023e2a1a46e118a2 (diff) | |
download | translated-content-844f5103992238c0c23203286dad16a466e89c97.tar.gz translated-content-844f5103992238c0c23203286dad16a466e89c97.tar.bz2 translated-content-844f5103992238c0c23203286dad16a466e89c97.zip |
move *.html to *.md
Diffstat (limited to 'files/fr/web/javascript/reference/statements/do...while/index.html')
-rw-r--r-- | files/fr/web/javascript/reference/statements/do...while/index.html | 87 |
1 files changed, 0 insertions, 87 deletions
diff --git a/files/fr/web/javascript/reference/statements/do...while/index.html b/files/fr/web/javascript/reference/statements/do...while/index.html deleted file mode 100644 index 4913e642ce..0000000000 --- a/files/fr/web/javascript/reference/statements/do...while/index.html +++ /dev/null @@ -1,87 +0,0 @@ ---- -title: do...while -slug: Web/JavaScript/Reference/Statements/do...while -tags: - - JavaScript - - Reference - - Statement -translation_of: Web/JavaScript/Reference/Statements/do...while -original_slug: Web/JavaScript/Reference/Instructions/do...while ---- -<div>{{jsSidebar("Statements")}}</div> - -<p>L'instruction <strong><code>do...while</code></strong> crée une boucle qui exécute une instruction jusqu'à ce qu'une condition de test ne soit plus vérifiée. La condition est testée après que l'instruction soit exécutée, le bloc d'instructions défini dans la boucle est donc exécuté au moins une fois.</p> - -<div>{{EmbedInteractiveExample("pages/js/statement-dowhile.html")}}</div> - -<h2 id="Syntaxe">Syntaxe</h2> - -<pre class="syntaxbox">do - <em>instruction</em> -while (<em>condition</em>); -</pre> - -<dl> - <dt><code>instruction</code></dt> - <dd>Une instruction exécutée au moins une fois et ré-exécutée chaque fois que la condition de test est évaluée à <code>true</code>. On peut exécuter plusieurs instructions au sein d'une boucle grâce à l'instruction {{jsxref("Instructions/block", "block")}} (<code>{ ... }</code>) qui permet de grouper différentes instructions en une seule.</dd> - <dt><code>condition</code></dt> - <dd>Une expression évaluée après chaque passage dans la boucle. Si l'évaluation de la <code>condition</code> donne <code>true</code> (la condition est vérifiée), <code>instruction</code> sera exécutée à nouveau. Lorsque <code>condition</code> donne <code>false</code>, le contrôle passe à l'instruction suivant la boucle <code>do...while</code>.</dd> -</dl> - -<h2 id="Exemples">Exemples</h2> - -<h3 id="Utiliser_do...while">Utiliser <code>do...while</code></h3> - -<p>Dans l'exemple suivant, la boucle <code>do...while</code> est parcourue au moins une fois et répétée jusqu'à ce que <code>i</code> ne soit plus strictement inférieur à 5.</p> - -<pre class="brush: js">var i = 0; -do { - i += 1; - console.log(i); -} while (i < 5); -</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('ES3')}}</td> - <td>{{Spec2('ES3')}}</td> - <td>Définition initiale. Implémentée avec JavaScript 1.2</td> - </tr> - <tr> - <td>{{SpecName('ES5.1', '#sec-12.6.1', 'instruction do-while')}}</td> - <td>{{Spec2('ES5.1')}}</td> - <td></td> - </tr> - <tr> - <td>{{SpecName('ES6', '#sec-do-while-statement', 'instruction do-while')}}</td> - <td>{{Spec2('ES6')}}</td> - <td>Le point-virgule de fin est désormais optionnel.</td> - </tr> - <tr> - <td>{{SpecName('ESDraft', '#sec-do-while-statement', 'instruction do-while')}}</td> - <td>{{Spec2('ESDraft')}}</td> - <td></td> - </tr> - </tbody> -</table> - -<h2 id="Compatibilité_des_navigateurs">Compatibilité des navigateurs</h2> - - - -<p>{{Compat("javascript.statements.do_while")}}</p> - -<h2 id="Voir_aussi">Voir aussi</h2> - -<ul> - <li>{{jsxref("Instructions/while", "while")}}</li> - <li>{{jsxref("Instructions/for", "for")}}</li> -</ul> |