DATATYPES
Every programming language uses datatypes to signify the kind of information that's being used. JavaScript is a weakly typed language; it will convert the datatype of a variable depending on the context in which it's used. This can be a convenience, but it can also cause unexpected problems in your code. You'll look at this issue more closely later in this lesson when you concatenate (add together) one or more strings.
The following are three basic datatypes that JavaScript uses:
- numerical: Includes integers (numbers without decimal points) and floating-point numbers (numbers that include decimal points)
- string: A string is simply a collection of one or more text characters.
You identify a string as text by enclosing it in quotation marks; for
example, "3" is considered and acted on as string data, whereas
3 is treated as numerical data.
- Boolean: True or false.
