What does this means....

Discussion in 'Javascript' started by Damon Chong, May 2, 2006.

  1. Damon Chong

    Damon Chong Guest

    I saw a declaration like below and wonder what it means. Can someone
    please explain to me? Thanks a million.

    var doggy = {};

    Regards,
    Damon
    Damon Chong, May 2, 2006
    #1
    1. Advertising

  2. Damon Chong

    RobG Guest

    Damon Chong wrote:
    > I saw a declaration like below and wonder what it means. Can someone
    > please explain to me? Thanks a million.
    >
    > var doggy = {};


    It is an object initialiser and is equivalent to:

    var doggy = new Object();



    --
    Rob
    RobG, May 2, 2006
    #2
    1. Advertising

  3. Damon Chong

    Damon Chong Guest

    Any difference between this and if I initialize like below?

    var doggy = [];

    Cheers!
    Damon Chong, May 2, 2006
    #3
  4. Damon Chong

    RobG Guest

    Damon Chong wrote:
    > Any difference between this and if I initialize like below?


    Between 'this' and what? Oh, you mean:

    var doggy = {};


    > var doggy = [];


    Yes, that will create an Array object, not an Object object.


    --
    Rob
    RobG, May 2, 2006
    #4
  5. Damon Chong

    Damon Chong Guest

    Oh...thank you and have a good day!
    Damon Chong, May 2, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rookie
    Replies:
    4
    Views:
    14,748
    Chris Langsenkamp
    Aug 20, 2003
  2. news.microsoft.com
    Replies:
    1
    Views:
    1,218
    Justin Martin
    Aug 10, 2003
  3. ronaldlee
    Replies:
    3
    Views:
    3,543
    Hans Kesting
    Dec 16, 2004
  4. Vijay
    Replies:
    1
    Views:
    3,069
    Martin Honnen
    Mar 22, 2005
  5. gk
    Replies:
    8
    Views:
    10,342
    Kent Paul Dolan
    May 24, 2006
Loading...

Share This Page