JS
DATA TYPES - Basics
PRIMITIVE IMMUTABLE
NON PRIMITIVE MUTABLE
COMPOSITE COMBINATION OF PRIMITIVE & OTHER DATA TYPES
TRIVIAL PRE DEFINED VALUES
Java script data types are classified into following three types
1. PRIMITIVE NUMBER, STRING, BOOLEAN
2. TRIVIAL NULL, UNDEFINED
3. COMPOSITE OBJECT, ARRAY
NUMBER
int,float
STRING
‘word’
“Words”
‘5’
“Everything inside the quote”
BOOLEAN
True
False
ARRAY
[]
container used to store list of data
Mixed data types
Numbered Index
[1,2,3,a,b,c]
OBJECT
{}
{“name”: “Happy” , “Place”:“Youtube”}
Named Index
NULL
UNDEFINED
NULL VS UNDEFINED
var a ; (undefined - nothing)
var b = null; (null – Something)
var c=5;
var d = a+c // NaN
var e = b+c //5
null !== 0; undefined !==0;
How to write Quotes Inside String Data Type
I ‘m here
“ Happy Learning “
METHOD 1 – Opposite Quotation
“I ‘m here “
‘ “ Happy Learning “ ‘
METHOD 2 – Backslash
‘ I \’m here ‘
‘ \“ Happy Learning \“ ‘
This method is suitable for text editor only not for console
Comments
Post a Comment