The NULL is object or primitive? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

The NULL is object or primitive?

There is people say that NULL is object and others say it's primitive !! What the true and if it's object or primitive explain why

10th Feb 2019, 9:48 AM
Hossam Hassan
Hossam Hassan - avatar
6 Answers
+ 3
Its an historical consequence by the fact than null was represented like an object in internal representation and not more changed for dont break old codes.... See here http://2ality.com/2013/10/typeof-null.html
10th Feb 2019, 11:03 AM
KrOW
KrOW - avatar
+ 2
👍👍👍
11th Feb 2019, 12:15 AM
KrOW
KrOW - avatar
10th Feb 2019, 9:51 AM
Jomari Pantorilla
Jomari Pantorilla - avatar
+ 1
KrOW thank you much
11th Feb 2019, 12:14 AM
Hossam Hassan
Hossam Hassan - avatar
0
Why then when I write typeof NULL... the output is object ? Jomari Pantorilla
10th Feb 2019, 9:59 AM
Hossam Hassan
Hossam Hassan - avatar
0
How it represents the intentional absence of any object value ?
10th Feb 2019, 10:01 AM
Hossam Hassan
Hossam Hassan - avatar