contents   index   previous   next

String as data type


A string is an ordered series of characters. The most common use for strings is to represent text. To indicate that text is a string, it is enclosed in quotation marks. For example, the first statement below puts the string "hello" into the variable hello. The second sets the variable word to have the same value as a previous variable hello:


var hello = "hello";

var word = hello;


Escape sequences for characters

Single quote

Back quote