Eritrean Cities
JavaScript
10 pts
Eritrean Cities
Create an array cities with these four strings, in this order: "Asmara", "Keren", "Massawa", "Mendefera".
Then print the first city, the last city and the number of cities:
First: Asmara Last: Mendefera Cities: 4
Read the values from the array: use cities[0] for the first, cities[cities.length - 1] for the last, and cities.length for the count.
Checklist
- Create the array
citieswith the four cities in order. - Read the first and the last city by index.
- Print the three lines.
🔑 Solution
If you view the solution before passing, you earn half points for this exercise. You still need to type it and press Check to finish.
How it works, step by step
Point at a step to highlight its lines. Type the solution yourself and press Check answer to finish.
