Strings and Arrays are Viewed as Objects in JavaScript
In JavaScript, strings are stored as objects. Strings can be declared in two ways. The first one is by assigning the value within double quotes and the second one is by using the new keyword.
mystring=“Welcome to JavaScript”;
mystring=new String(“Welcome to JavaScript”);
Both the above declarations are valid and there is absolutely no difference between the two.
Calculating the length of the string
The length of a string can be calculated by using the length () method.
