Évaluation demandée pour le test Tableaux JavaScript

Bonjour,
Je suis nouveau sur la plateforme.
Pour l’exercice no 3 sur les tableau en javascript, j’ai réussis a faire tous les étapes demander. Le seul problème que j’ai eu c’est comment ajouter les parentheses() pour chaque index du tableau.
Exercice-3, Javascript Array.
Lien MDN pour l’exercice.

Hello @Ousmane_Tanor_Cisse

you doing great and you very close to do it
so i will give you hint

the question ask you to replace each element in the array with the same element + (it’s index)

so

Ryu the first element in the array will be Ryu (0) you do not need to do any search

if that did not help then let me know and i will try to explain it in better way and have a nice day :slight_smile:

2 Likes

Hello @justsomeone
I’m good and you?
But how can I have the index of an element in the result?

Hello @Ousmane_Tanor_Cisse

glad to know that you good and fine thanks :slight_smile:

in your for loop i is the index since it start from 0 till the last element

so all you need to do inside that for loop to set the element in certain index to be = the new value
so

myArray[i] += " (" + i +")";

hope that help and have a nice day :slight_smile:

2 Likes

yes that work well now .
Thank you for the helps.

1 Like

you very welcome :slight_smile:

1 Like