Why is null an object and what’s the difference between null and undefined?

soniajain

Newbie
Joined
May 15, 2023
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Location
United States
Activity points
34
For what reason null considered an object in JavaScript?

Code:
if ( object == null )     
Do something

the same as
Code:
if ( !object )     
Do something

Additionally, could somebody at any point put a portion of their perspectives on the contrast among null and undefined?
 

Cookies are required to use this site. You must accept them to continue using the site. Learn more…