Declare an array of five colors and print the first and last colors.
EasyProblem Statement
Declare an array of five colors and print the first and last colors.
Sample Input
["red", "blue", "green", "yellow", "purple"]
Sample Output
red purple
Limits
Time: 2s · Memory: 256 MB
Code Editor
00:00
// Declare an array and print the first and last elements
let colors = ["red", "blue", "green", "yellow", "purple"];
console.log(colors);
console.log(colors);
Input
["red", "blue", "green", "yellow", "purple"]
Expected Output
red purple