-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNull_Undefined.js
More file actions
29 lines (20 loc) · 1.01 KB
/
Null_Undefined.js
File metadata and controls
29 lines (20 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*JavaScript types can be classified into 2 categories: Primitive and Objective
Primitive types include:
numbers
strings
booleans
symbol
null
undefined
Non primitive types are objects.
Object types have properties and have methods that can act on those properties.
Primary difference is that primitive types store one value, while object types store many properties.
In addition, primitive types are passed by 'value' and object types are passed by 'reference.
Arrays are not a type in JavaScript. Arrays are objects.
*/
/*JavaScript defines two special types, which both have only one value assigned: null and undefined.
Null is a special value that indicates the 'absence' of a value. (defined as None in Python)
Undefined indicates that a variable has not been initialized and the value is absent.
It’s commonly returned by functions with no return value. Example, when a function accepts a parameter
that’s not set by the caller, this results in an undefined error.
*/