The Character Hunter
Easy+15 XP
Mission Briefing
The elusive Character Hunter is tracking a beast that only leaves clues at the second step of every path. You must write a script to automatically extract this clue!
The Concept: String Access
Strings act very similar to arrays. You can get a character at a specific position using the .charAt(index) method, or by using bracket notation like str[index].
And just like arrays, strings are zero-indexed!
Example: "JavaScript"[0] // Returns "J"
The Objective
Your function receives a string word.
- Extract the character located exactly at index 1 (which is the second character).
- Return that single character.
01EXAMPLE 1
Input
word = "Code"Output
"o"Constraints
- Return the single character at index 1.
FundamentalsStrings
JavaScriptSystem handles I/O — write your function only
Loading...
3 Hidden
Input Arguments
word"Apple"
Expected Output
p
Click RUN to test your solution