Short Notes of Javascript’s Data Types: Numbers, Strings, Booleans, Functions and Objects

Pulack Hassan
2 min readNov 2, 2020

--

Javascript is a scripting or programming language. It is mostly used for making website interactive. Otherwise it is also widely used for making software. Now a days, in our daily computing life we use at least one software what is created by using javascript.

To be familiar with javascript programming language, first of all we need to have an idea about the javascript’s data types. Because all manipulated values using javascript belong to a data type. Data type is a important concept in programming. The data types of different programming languages may different from each other.

There are many data types include in javascript. But the main Javascript’s data types are — Number, String, Boolean, Function, Object. Here I will give a very short description about these types.

Numbers: Javascript has only one data types about number. It can be written with or without decimals. In javascript numbers, the maximum number of integers are 15 digits and the decimals are accurate up to 17 digits. Extra large or extra small numbers can be written with exponent notation.

Strings: Strings are written into quotes(‘ ‘). Single quotes or double quotes doesn’t matter in javascript. If number is written into quote, then it will be identified as strings. If we don’t keep string into a quote, it will be misunderstood as string.

Booleans: Boolean data type contains two values- true and false. A javascript boolean provide one of them two values. Boolean data type mainly used in conditional statements. If conditional statement matches the required value, it will results to true. If not then the result goes to false.

Functions: All data types are important for programming. But function is more important than others. Because, we have to use function frequently while programming using javascript. It is easy to understand. Function is a block of code designed to perform a particular task. A javaScript function is defined with the function keyword, followed by a name, followed by parentheses (). The code to be executed, by the function, is placed inside ‘{}’ brackets.

Objects: Object is another important data type of javascript. objects can contain many values. An object is assigned into a variable with ‘{}’(curly brackets). The values are written as name:value pair and ‘,’(comma) between these pairs.

--

--

No responses yet