Home HTML CSS JAVASCRIPT BOOTSTRAP Python Docker ML tutorial About us Privacy policy

String in JavaScript



String



Strings are generally collection of characters.Strings are always arounds quotes ,it can be single qiotes or double quotes no problem at all.Strings are index based as well.




Strings with Single quotes or double quotes

As we know Strings can be enclosed either by using single quotes or double quotes or we can also use combination of single or double quotes.





Count length of the String

We can count the length of the String in javaScript by using length property.

Escape Character System

In general strings are always around the quotes,without quotes browser wonn't understand string format,so to overcome this problem we use backslashes.




How to break String

To improve the readablity of the code it's recomanded to break the lines of the code and make our code more readable.

Addition of String

We can also perform addition operation of a string by using + operator in javaScript.

String as a Object

In javascript string can be declare as object as well by using String class constructor .