Javascript Variables data types

Javascript Variables  and their Data Types

Javascript Variables data types: In every programming language variables are subject to different data types. These are used to suit the requirement of the programmer whether he requires strings, numbers, Booleans, arrays etc. as his data type. Every data type has its unique purpose in the programming paradigm. We do need to remember that besides being different in nature, these data types also carry the significance of the amount of space they use for storage of information in them. Below are the data types used in JS programming language:

String: It can contain text or alpha numeric characters. A string can be as small as a letter or as long as paragraphs. A string in JS is always surrounded by quotes.

Number: Numbers can contain numbers. No quotes are to be placed around numbers.

Boolean: Every programming language needs to know at times whether a statement would return true or false. The action is determined and dependent on the result. So, Booleans are either true or false value for the variable. No quotes for this data type.

Array: A variable can store more than one value with the help of array data type. Array stores values in a sequence as a single reference.

Object: In JS everything and anything is an object. We can include selection handlers too in this case. 



Leave a Reply