Assessment requested for Arrays 3

let myArray2 = [ “Ryu”, “Ken”, “Chun-Li”, “Cammy”, “Guile”, “Sakura”, “Sagat”, “Juri” ];
myArray2.pop();
myArray2.push(‘Fia’, ‘Hiu’);
console.log(myArray2);

const myArray2s = myArray2;
console.log(myArray2s);

let count = -1;
let myArray3s = [];
for (const myArray2 of myArray2s) {
count = count + 1;
const myArray3 = myArray2 + ‘(’ + count + ‘)’;
myArray3s.push(myArray3);
}
console.log(myArray3s);
const myString3 = myArray3s.join(’-’);
console.log(myString3);

Hello @texas-triumph

you doing great well done here some notice :

  1. your email is displayed next to your name so it better to hide it from you profile page

  2. no need to use console but if you did it to see the effect of each step then it’s fine

  3. if you used different variable name in the for loop you would not need to create new array

for (const myArray2 of myArray2s) { \\ change myArray2 to elment 
or anything else then you can use const element of myArray2 
then yo would not need to create myArray2s 
of course there better ways but you will learn about them
 later in the course

count = count + 1;
const myArray3 = myArray2 + ‘(’ + count + ‘)’;
myArray3s.push(myArray3);
}
  1. it better to put your code on any online service like codepen.io so it be easier for everyone to check it and just share link to that code

  2. it better to put link to the task or topic you asking about in the post

hope that help and have a nice day :slight_smile:

1 Like