CJCoding With Joseph
15free / daySign inCreate account

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, so print one after the last line.

Hints3 available
Topics
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.