Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > What does this means....

Reply
Thread Tools

What does this means....

 
 
Damon Chong
Guest
Posts: n/a
 
      05-02-2006
I saw a declaration like below and wonder what it means. Can someone
please explain to me? Thanks a million.

var doggy = {};

Regards,
Damon

 
Reply With Quote
 
 
 
 
RobG
Guest
Posts: n/a
 
      05-02-2006
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
 
Reply With Quote
 
 
 
 
Damon Chong
Guest
Posts: n/a
 
      05-02-2006
Any difference between this and if I initialize like below?

var doggy = [];

Cheers!

 
Reply With Quote
 
RobG
Guest
Posts: n/a
 
      05-02-2006
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
 
Reply With Quote
 
Damon Chong
Guest
Posts: n/a
 
      05-02-2006
Oh...thank you and have a good day!

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
.NET 2.0 ASPx Page does not load, but HTM does prabhupr@hotmail.com ASP .Net 1 02-08-2006 12:57 PM
Button OnClick does not fire on first postback, but does on second Janet Collins ASP .Net 0 01-13-2006 10:08 PM
Does the 2.0 Framework come out when Visual Studio .NET 2005 does? needin4mation@gmail.com ASP .Net 3 10-07-2005 12:55 AM
CS0234 Global does not exist ... but it genuinely does Bill Johnson ASP .Net 0 07-08-2005 06:34 PM
Does no one else think microsoft does a poor job? =?Utf-8?B?SmVyZW15IEx1bmRncmVu?= Wireless Networking 2 11-20-2004 12:17 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57