Index Explorer
Easy+15 XP
Mission Briefing
The Grand Archive stores data in massive numbered vaults. You need to retrieve the third scroll from a sealed collection.
The Concept: Array Basics
An Array is a special variable that can hold more than one value at a time. Each item in an array is stored in a numbered slot called an index, starting at 0.
arr[0]is the first item.arr[1]is the second item.arr[2]is the third item!
The Objective
Your function receives an array called data.
- Retrieve the third element from the array using bracket notation.
- Return that element.
- Remember that JavaScript arrays are zero-indexed!
01EXAMPLE 1
Input
data = ["Red", "Green", "Blue", "Yellow"]Output
"Blue"02EXAMPLE 2
Input
data = [10, 20, 30, 40]Output
30Constraints
- Access the third element (index 2).
FundamentalsArrays
JavaScriptSystem handles I/O — write your function only
Loading...
3 Hidden
Input Arguments
data["A","B","C","D"]
Expected Output
C
Click RUN to test your solution