# Assessment needed for JavaScript assignment array 3

**URL:** https://discourse.mozilla.org/t/assessment-needed-for-javascript-assignment-array-3/75675
**Category:** Learn
**Tags:** learning
**Created:** [February 18, 2021, 5:19pm UTC](https://discourse.mozilla.org/t/assessment-needed-for-javascript-assignment-array-3/75675 "2021-02-18T17:19:14Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![code-hunter](https://avatars.discourse-cdn.com/v4/letter/c/e79b87/32.png) [@code-hunter](https://discourse.mozilla.org/u/code-hunter)
#### Post date: [February 18, 2021, 5:19pm UTC](https://discourse.mozilla.org/t/assessment-needed-for-javascript-assignment-array-3/75675/1 "2021-02-18T17:19:14Z")

</div>

**This is the assignment**

For this final array task, we provide you with a starting array, and you will work in somewhat the opposite direction. You need to:

1. Remove the last item in the array.
2. Add two new names to the end of the array.
3. Go over each item in the array and add its index number after the name inside parentheses, for example `Ryu (0)` . Note that we don’t teach how to do this in the Arrays article, so you’ll have to do some research.
4. Finally, join the array items together in a single string called `myString` , with a separator of " `-` ".

i think i have done in a different way then how was expected but i guess i got it right anyway.would highly appreciate your feedback here 🙂

**here is the code**

```
let myString = 'Ryu+Ken+Chun-Li+Cammy+Guile+Sakura+Sagat+Juri';
let myArray = myString.split('+');
let lastItem = myArray.pop('Juri');
let newItems = myArray.push('Dalsim','Scorpio');
 let arrayWithIndex = myArray.forEach((item,index) => {console.log("Index:"+ index +" "+ item)});
let myNewString = myArray.join('-');
```
