Photo by Christopher Robin Ebbinghaus on Unsplash

Let’s talk about Strings, Well, to be able to exist inside the computers, string have to be modeled as series of bits and JavaScript does this using the Unicode standard. This standard assigns a number for every character for almost every language, even emojis, for instance we can said that every string can be described by a sequence of numbers.

But JavaScript use 16bits for strings elements and the Unicode standard defines more characters than the available for JavaScript and because of this some characters are defined with 2 elements.

We can define strings using single quotes, double quotes and backticks, for example:

To add especial characters as newline, tab and even double quotes inside of an string we use the special character backslash (\), this means wherever a backslash is founded inside the string, it indicates than the character after it has a special meaning, for example:

For other hand, strings can’t be divided, multiplied, or subtracted, but the + operator can be used to concatenates Strings, for example:

Also Backtick-quoted strings, usually called template literals enable us to do a litter more, we can inject others type of values and compute operations. But we have to write the code inside this element ${code here},for example:

We can do a lot with string, there is some methods to perform others operations, but from now let’s finish here.

You can checkout more information about strings here:

Passionate reading || Coding Addicted || FullStack Web Developer from Costa Rica

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store