# Assessment wanted for "Test your skills:Arrays" question #3

**URL:** https://discourse.mozilla.org/t/assessment-wanted-for-test-your-skills-arrays-question-3/53389
**Category:** Learn
**Tags:** learning
**Created:** [February 6, 2020, 12:35am UTC](https://discourse.mozilla.org/t/assessment-wanted-for-test-your-skills-arrays-question-3/53389 "2020-02-06T00:35:21Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![cazzimoto](https://avatars.discourse-cdn.com/v4/letter/c/a88e57/32.png) [@cazzimoto](https://discourse.mozilla.org/u/cazzimoto)
#### Post date: [February 6, 2020, 12:35am UTC](https://discourse.mozilla.org/t/assessment-wanted-for-test-your-skills-arrays-question-3/53389/1 "2020-02-06T00:35:21Z")

</div>

Chris (I presume),

Looking for assistance.

Link to what I have so far: [https://jsfiddle.net/cazzimoto/s0rfvtyz/8/](https://jsfiddle.net/cazzimoto/s0rfvtyz/8/)

Link to what I believe will work for solution: [https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref\_foreach](https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_foreach)

- I even edited the code from w3scho… mixing item and index and added (index) and got the desired result!

I am having trouble connecting the dots between the two.

Thank you in advance for you help. It is MUCH appreciated!

V/R,  
cazzimotto

---

<div class="post-metadata">

### Author: ![chrisdavidmills](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/chrisdavidmills/32/21688_2.png) [@chrisdavidmills](https://discourse.mozilla.org/u/chrisdavidmills)
#### Post date: [February 6, 2020, 4:35pm UTC](https://discourse.mozilla.org/t/assessment-wanted-for-test-your-skills-arrays-question-3/53389/2 "2020-02-06T16:35:13Z")

</div>

@cazzimoto hi there!

Yes, you are definitely right that `forEach()` will help you here. Inside the `forEach()` callback, you’ve got the array item and its index value made available.

One problem is that the array values inside `forEach()` are not “live”, meaning that if you change the value with something like `item = newValue`, it won’t work.

The item is only a copy of the item in the array, rather than the actual item in the array, if that makes sense? So instead, you’ll have to create the new value for the array item, and then copy it back to the actual array with something like `myArray[index] = newValue`.

Let me know if that helps. Good luck!

---

<div class="post-metadata">

### Author: ![cazzimoto](https://avatars.discourse-cdn.com/v4/letter/c/a88e57/32.png) [@cazzimoto](https://discourse.mozilla.org/u/cazzimoto)
#### Post date: [February 7, 2020, 9:52pm UTC](https://discourse.mozilla.org/t/assessment-wanted-for-test-your-skills-arrays-question-3/53389/3 "2020-02-07T21:52:48Z")

</div>

@ chrisdavidmills

Thank you for the reply!

I am still having issue finding the solution. I have tried an assortment of solutions, all of which have not produced the desired outcome. The best of what I have put together follow:

let last = myArray.pop();  
myArray = myArray.push(‘Fei Long’, ‘Balrog’);

for (let 1 = 0; i \< myArray.length; i++) {  
let breaker = myArray[i].split(’,’);  
let name = breaekr[0];  
let index = breaker[2];  
let finalArray = name + ‘-’ + index;  
let list = finalArray.toString;  
}

AND THIS TO TEST:  
let last = myArray.pop();  
myArray = myArray.push(‘Fei Long’, ‘Balrog’);

myArray.forEach((myArray, index) ==\> {  
console.log(myArray, index);  
});

Again, thank you for your assistance.

V/R,  
cazzimoto

---

<div class="post-metadata">

### Author: ![chrisdavidmills](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/chrisdavidmills/32/21688_2.png) [@chrisdavidmills](https://discourse.mozilla.org/u/chrisdavidmills)
#### Post date: [February 10, 2020, 11:22am UTC](https://discourse.mozilla.org/t/assessment-wanted-for-test-your-skills-arrays-question-3/53389/4 "2020-02-10T11:22:51Z")

</div>

Hi @cazzimoto! Nice try, but yeah, you’re getting a bit confused here. Have a look at marking guide for this one, so you can check out what we did: [https://github.com/mdn/learning-area/blob/master/javascript/introduction-to-js-1/tasks/arrays/marking.md#task-3](https://github.com/mdn/learning-area/blob/master/javascript/introduction-to-js-1/tasks/arrays/marking.md#task-3)
