DEV Community

Raisan JMR
Raisan JMR

Posted on

What is JavaScript String charAt() and charCodeAt()

first lets see charAt() in javascript

it is simple

  • charAt() method returns the character at a specified index in
    a string

  • The index of the first character is 0, the second 1, third 3

  • The index of the last character is string length - 1
    charAt()

now lets see what is charCodeAt() in javascript

  • charCodeAt() method returns Unicode of the the character at a
    specified index in a string.

  • The index of the first character is 0, the second is 1, third 3

  • The index of the last character is string length - 1

  • both uppercase and lowercase characters has seperate unicode
    values

charCodeAt()

Hope your dots connected!!!! : )

Top comments (0)