← Back to Arrays
Question 96
First and Last Fruit
First and Last Fruit
You are given an array of fruit names. Arrays are indexed starting at 0, so the first element is at index 0 and the last element is at index length - 1. Print the first fruit on one line and the last fruit on the next line using two console.log statements.Expected Output:
apple date
= newline. The output ends with a newline — print one after the last line.
Hints3 available
Sign in to use hintsTopics:
Arrays
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (clog, fn, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.