It helps you to represent the numerical data in JS. There are several arithmetic operations like addition , subtraction , multiplication, division, modulus etc. which acts on the numeric values in order to perform mathematical calculations. Calculations in whole number will give us the precise value in JS but there might be some approximation taken when dealing with non-whole numbers calculations in JS. If you really want to represent a very big number (like astronomical numbers) in JS, you can use the ‘ e’ syntax (e stands for exponential ).
var number = 10*e5; or
var number = 10*e-10;
It helps you to represent any character in JS but make sure to keep them inside quotes (the starting quote needs to match with the ending quote). Strings can’t be multiplied, divided, subtracted but we can add them. Concatenation is the way in which we can add two strings, for that we use ‘+’ operator.
var data = 'two' + 'strings';
data will give us the result
It holds a value which distinguishes between two possibilities
Logical operator is used for Boolean values.
&& (Logical And) : It is a binary operator. If both the values applied to it are
true then only the result is
||(Logical Or) : It is a binary operator. If any of the values applied to it is
false then the result is
false else it will be
! (Logical not) : It is a unary operator. It used for flipping the value. When we give it
true, we get the result as
false, the same works for
It denotes the absence of a meaningful value. There are two values one is
null and another is
undefined which don’ t carry any meaningful information. There are some differences between
undefined , one of them is their type —
A piece of program wrapped in brackets in order to produce a value is called a function. Function may return a value or it may produce any visible clue or internal state change. You can also write a function which does the both.
Objects are the value that allow us to group different types of value (object also).
Objects consist property which will contain any value (functions also). By using these properties, we can manipulate with the Object.
Closing Notes :
Thanks for reading. Kindly let me know about the points which I missed, I will describe about each value types in JS in more details in the next blog and please click on the clap button If you found this blog helpful.