0 votes
in JavaScript by
If we want to return the character from a specific index which method is used?

1 Answer

0 votes
by

The JavaScript string charAt() method is used to find out a char value present at the specified index. The index number starts from 0 and goes to n-1, where n is the length of the string. The index value can't be a negative, greater than or equal to the length of the string. For example:

  1. var str="Javatpoint";    
  2. document.writeln(str.charAt(4));    

Related questions

0 votes
asked Oct 19, 2019 in JavaScript by SakshiSharma
0 votes
asked May 23, 2020 in NoSQL by Robindeniel
...