# Aide demandée pour le test Tableaux JavaScript

**URL:** https://discourse.mozilla.org/t/aide-demandee-pour-le-test-tableaux-javascript/92656
**Category:** Learn
**Tags:** learning
**Created:** [February 8, 2022, 5:58pm UTC](https://discourse.mozilla.org/t/aide-demandee-pour-le-test-tableaux-javascript/92656 "2022-02-08T17:58:14Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![tsoungov](https://avatars.discourse-cdn.com/v4/letter/t/c2a13f/32.png) [@tsoungov](https://discourse.mozilla.org/u/tsoungov)
#### Post date: [February 8, 2022, 5:58pm UTC](https://discourse.mozilla.org/t/aide-demandee-pour-le-test-tableaux-javascript/92656/1 "2022-02-08T17:58:14Z")

</div>

Bonjour, svp pourriez-vous m’aider?

A partir du script ci dessous je n’arrive pas à créer une fonction qui va permettre de parcourir chaque élément du tableau et ajouter son indice, entre parenthèses, après le nom (par exemple `Ryu (0)` ) et à fusionner les éléments du tableau dans une chaîne de caractères intitulée `myString` en utilisant " - " comme séparateur.  
J’ai essayer avec splice  
let myString = myArray.slice("-"); malheureusement ça ne fonctionne pas et ça sépare les éléments du tableau par une virgule et non pas par un tiret.

Merci d’avance.

 Arrays: Task 3 p { color: purple; margin: 0.5em 0; }

```
  * {
    box-sizing: border-box;
  }
</style>
<link rel="stylesheet" href="../styles.css" />

```

```
<section class="preview">

</section>

```

---

<div class="post-metadata">

### Author: ![tsoungov](https://avatars.discourse-cdn.com/v4/letter/t/c2a13f/32.png) [@tsoungov](https://discourse.mozilla.org/u/tsoungov)
#### Post date: [February 8, 2022, 6:00pm UTC](https://discourse.mozilla.org/t/aide-demandee-pour-le-test-tableaux-javascript/92656/2 "2022-02-08T18:00:48Z")

</div>

Voici le lien du code source:

> <https://github.com/mdn/learning-area/blob/main/javascript/introduction-to-js-1/tasks/arrays/arrays3-download.html>

---

<div class="post-metadata">

### Author: ![mikoMK](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/mikomk/32/50456_2.png) [@mikoMK](https://discourse.mozilla.org/u/mikoMK)
#### Post date: [February 9, 2022, 7:50pm UTC](https://discourse.mozilla.org/t/aide-demandee-pour-le-test-tableaux-javascript/92656/3 "2022-02-09T19:50:53Z")

</div>

Hi @tsoungov and welcome to the community 👋

For this task you need the [`join()` function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join). It’s used to create a string from an array with a separator that you can choose yourself and add as parameter.

Tell me if you need more help 🙂

Have a nice day,  
Michael
