top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration

Facebook Login
Site Registration

What is the difference between undefined value and null value?

0 votes
108 views
What is the difference between undefined value and null value?
posted Aug 6, 2014 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

Undefined: a variable has been declared but has not yet been assigned a value.
null: It can be assigned to a variable as a representation of no value.

Example (Undefined):

 var a;
 alert(a); //shows undefined
 alert(typeof a); //shows undefined

Example (null):

 var a = null;
 alert(a); //shows null
 alert(typeof a); //shows object
answer Aug 6, 2014 by Salil Agrawal
Similar Questions
+1 vote

I search most of the article available in the internet, but i am able to clear on this two statement

1/0 is undefined or infinity.
1/infinite is zero or undefined.

But i am clear about the things if we will use lim (x->infinite) 1/x approaches to zero

Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...