Get nth character of string
How to solve it
In order to get the nth character of a given string, you have to know its index. An index describes the position of a character in a given string. Javascript strings are zero-indexed. This means that the first character of a string has index 0. The second character has index 1 and so on.
const string = 'abcdefg';
// get first character
console.log(string[0])
// output: 'a'
// get third character
console.log(string[2])
// output: 'c'