A Quick Recap

What do you remember about strings back from the JavaScript Data Types chapter?

Let's take a quick recap on the topic, in fact a quite detailed recap.

Strings are text values that can contain alphanumeric characters, spaces, newlines, symbols, emoticons and so on.

They can be denoted using single quotes ', or double quotes ", or even backticks `. Strings given with backticks are special in that they are parsed before being returned. We'll discover more to backticks in the next chapter.

Following we create two strings str1 and str2, using single and double quotes respectively:

var str1 = 'Hello World!';
var str2 = "Hello World!";

Importance of Strings

Imagine having programs that showed nothing to the end user - no text at all and just carried some functions behind the scenes. You might consider them programs but not good programs.

A good program amongst other features has the feature of interacting with the user like a real person.

Such interaction isn't possible unless you write something (or say something) to the end user and to write something you largely need strings.

Whether you want to exchange data between the client and server, manipulate databases, write error messages, create alerts, retrieve form input etc. you will have to, in some form, use strings.

Without strings we could even hardly imagine a basic program. To boil this down to the very basic level, consider the fact that to introduce any programming languages' basics, resources usually first show the user how to output the conventional string "Hello World" to the computer screen.

Moving On

Now that you know what strings are and what importance they hold, we can now focus on some key concepts in strings, like the concept of immutability, and some built-in features that come with JavaScript for strings.