What goes in the blank?
// returns the first character of the string s
function firstChar(s: string): string {
return s[____];
}
Answer: 0
Index 0 is the first character of a string.
Play Problem Solving ▸
// returns the first character of the string s
function firstChar(s: string): string {
return s[____];
}
Answer: 0