What is the output of `’abc’.charAt(10)`?

JavaScript Professional Easy

JavaScript Professional — Easy

What is the output of `’abc’.charAt(10)`?

Key points

  • The charAt() method returns an empty string if the specified index is out of range.
  • In this case, the index 10 is beyond the length of the string 'abc'.
  • Therefore, the method returns an empty string as the output.

Ready to go further?

Related questions