dcsimg
Results 1 to 3 of 3

Thread: What is the difference between undefined and null in JavaScript?

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2019
    Posts
    5

    Post What is the difference between undefined and null in JavaScript?

    What is the difference between undefined and null in JavaScript?

  2. #2
    Hyperactive Member coothead's Avatar
    Join Date
    Oct 2007
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    276

    Re: What is the difference between undefined and null in JavaScript?

    Hi there Siddhi Patel,


    this might possibly help with your enlightenment...



    ~ the original bald headed old fart ~

  3. #3
    Junior Member
    Join Date
    Jul 2019
    Location
    Ahmedabad
    Posts
    18

    Re: What is the difference between undefined and null in JavaScript?

    undefined means a variable has been declared but has not yet been assigned a value and null is an assignment value which can be assigned to a variable as a representation of no value.

    Code:
    var test;
    var testTry =" ";
    alert(test); //undefined
    alert(testTry); //null

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width