Data is of various types and is processed by javascript differently. For example it can be numeric, text etc. Mathematical operations like addition, subtraction can only be performed on data that is numeric in nature.
Variable data type cannot be specified in javascript.
It is different from variable type in the sense that a variable type can have various sub data types. Like numeric data can have data types integers, floating points and many others in various programming languages. ???? like short and long integers in other programming languages or that is also variable sub types?
Similarly every data type has some properties and only some specific operations can be performed on a type.
Strongly and Loose / Dynamic Typed languages
In some languages, while defining a variable or generally dealing with data we have to mention its data type. Such languages are also know as 'Strongly typed languages'.Javascript losely typed language in the sense that dont have to specify data type. Javascript guesses on its own based on the type of actions the user is trying to perform. However it is not accurate all the time, and there are situations where we need to tell it, how to handle data.
Numerical Data
- Integers or whole numbers- Can be in positive or negative. Ex. 54, 211230, -4, -342
- Floating Point Numbers or Decimal numbers. Ex 99.5, 0.3, 2132.98
No comments:
Post a Comment