var fruit = ["banana", "apple", "orange", "watermelon"]; var vegetables = ["carrot", "tomato", "pepper", "lettuce"];
After every command, console.log() your arrays. A good way to do that is to use:
console.log("fruit: ", fruit); console.log("vegetables: ", vegetables);
- Remove the last item from the vegetable array.
- Remove the first item from the fruit array.
- Find the index of "orange."
- Add that number to the end of the fruit array.
- Use the length property to find the length of the vegetable array. Log that to the console.
- Add that number to the end of the vegetable array.
- Put the two arrays together into one array. Fruit first. Call the new Array "food".
- Remove 2 elements from your new array starting at index 4 with one method.
- Reverse your array.
- Log your array as a string to the console.
If you've done everything correctly, the last step should print the following to the console: