Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

charAt javascript

myString = "Hello World!";

console.log(myString.charAt(0)); // outputs "H"
console.log(myString.charAt(5)); // outputs " "
console.log(myString.charAt(8)); // outputs "r"
/* If the specified index is bigger or equal to the length of the string
   the output will be "". */
console.log(myString.charAt(23)); // outputs ""
Source by www.freecodecamp.org #
 
PREVIOUS NEXT
Tagged: #charAt #javascript
ADD COMMENT
Topic
Name
5+6 =