Menu
Coddy logo textTech

Array Challenge #2

Lesson 4 of 18 in Coddy's Array Methods in JavaScript course.

challenge icon

Challenge

Easy

Imagine having a basket full of candies of different colors. 

Create an array named candyBasket containing five candies: "red", "orange", "yellow", "green", "blue".

 Write JavaScript code to determine and log the color of the candy in the middle of the basket based on its index.

Try it yourself

// Write code here

All lessons in Array Methods in JavaScript