- String
- Integer
- Float
- Array
- Boolean
Strings are phrases or characters that are surrounded by quotation marks.
Example:
var greeting = "Hello, how are you today?";
Integers are positive or negative whole numbers (includes zero). Floats are similar; they include all numbers with decimals. Example:
An integer: var population = 4;
A float: var average = 4.5;
An array is a collection or series of data types. The data could be strings, integers, floats, or boolean values.
Example:
var animalFarm = ["Chicken", "Cow", "Pig", "Duck"];
var animalLegs = [ 2, 4, 4, 2];
A boolean value is used to perform logic with statements that are either true or false.
Example:
var happy = true;
var sad = false;
@KCWill amazing image