3. String Methods and Properties


          Strings is a kind of data type in JavaScript. The individual elements in a string are called characters. Before going into methods, let us learn how to manipulate strings and the individual characters inside it.

          To declare a string, code it like how you would declare a number.

var name = "Uzumaki Naruto"

          To access any character inside the string, we can use the format stringName[x] where x is the index of the character that we want to access. Refer to the sample code below:

x = name[0] // returns "U"
y = name[1] // returns "z"
z = name[7] // returns the space character 
a = name[20] // returns undefined

          Listed below are some operations that you can perform on strings.