Variables are named containers that can store data and Type is a classification identifying one of various types of data. Data can come in many different types
Normally most of the programming languages feature strongly typed variables. When programming with these languages, we should explicitly state what sort of data we are dealing with, and use of those data should follow strict rules applicable to its datatype. For example, we can't add a numeric and a string together in Strongly Typed languages.
Primary Data Types (Primitive)
Composite Data Types (reference)
Special Data Types
String : A strings of any characters enclosed in quotes is a string primitive.
Boolean : It will store Variables or expressions which are either true or false.
Arrays : Arrays are regular objects, both objects and arrays can have properties and methods.
Undefined : It treated as a variable that has been declared, but has never had a value assigned to it.
The above statement declare a variable in var type, since var is a dynamic types, it can be use to store any type of data such as numeric, string etc.
In the above statement anyData hold a string value, string can used inside singles quotes and double quotes.
In the above statement anyData hold a numeric value;
In the above statement anyData hold a Boolean value;
Assigning Var variables with the Value of Other Variables
Combining Data Types
output is 30 is the result
output is result is 1020