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.

  1. Extract the character located exactly at index 1 (which is the second character).
  2. Return that single character.

01EXAMPLE 1

Inputword = "Code"
Output"o"

Constraints

  • Return the single character at index 1.
FundamentalsStrings
JavaScript
Loading...
3 Hidden

Input Arguments

word"Apple"

Expected Output

p

Click RUN to test your solution