For instance, there are just three simple data types:
boolean. Each is specifically differentiated
by the literal it contains: string, numeric, and boolean. However, there
are also built-in objects known as
boolean. These would seem to be the same
thing, but arenât: the first three are classifications of primitive
values, while the latter three are complex constructions with a type of
Rather than mix type and object, in the next three sections, weâll look at each of the simple data types, how theyâre created, and how values of one type can be converted to others. In Chapter 4, weâll look at these and other built-in JS objects, and the methods and properties accessible with each.
The String Data Type
string variable was
demonstrated in Example 2-1. Since
differentiate it from a variable thatâs a number or a boolean, other
than the literal value assigned it when itâs initialized and the
context of the use.
A string literal is a sequence of characters delimited by single or double quotes:
"This is a string" 'But this is also a string'
There is no rule as to which type of quote you use, except that the ending quote character must be the same as the beginning one. ...