February 27, 2000 - Accessing String's Characters
![]() |
February 27, 2000 Accessing String's Characters Tips: February 2000
Yehuda Shiran, Ph.D.
|
foobar, then the third character of this string would have been foobar[2]. In JavaScript, this is not that trivial. You need to use the charAt() method. It takes a single parameter: the index of the character in the string. Back to our above example, the third character of foobar could be derived as follows:
foobar.charAt(2)


Find a programming school near you