JAVASCRIPT

All Languages C CPP JAVA HTML CSS JAVASCRIPT PYTHON

JavaScript Data Types

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

Strongly Typed

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.

Weakly Typed

On the other hand, Javascript variables are loosely typed, meaning that a variable can hold any type of data. When we deal with data in Javascript, we often don't need to specify type of data, instead Javascript will work that out for itself. Moreover, when you are using different types of data at the same time, JavaScript will work out behind the scenes what you're trying to do

Javascript Data structures

Even though Javascript is loosely typed language, it actually does have data types (also called primitive types). Normally there are three Primary data types and two Composite data types and Two special Data Types in Javascript

Primary Data Types (Primitive)

Data Type Description
String represents sequence of characters e.g. "hello"
Number represents numeric values e.g. 100
Boolean represents boolean value either false or true

Composite Data Types (reference)

Special Data Types