473,654 Members | 3,076 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What does this means....

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

var doggy = {};

Regards,
Damon

May 2 '06 #1
5 1491
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
May 2 '06 #2
Any difference between this and if I initialize like below?

var doggy = [];

Cheers!

May 2 '06 #3
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
May 2 '06 #4
Damon Chong wrote:
Any difference between this and if I initialize like below?

var doggy = [];

Cheers!


It helps if you quote context from the message to which you are replying.

Yes, there is a difference. Restoring your missing context:
var doggy = {};


It is an object initialiser and is equivalent to:

var doggy = new Object();

Any difference between this and if I initialize like below?

var doggy = [];


That one is equivalent to:

var doggy = new Array();

May 2 '06 #5
Oh...thank you and have a good day!

May 2 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

125
14702
by: Sarah Tanembaum | last post by:
Beside its an opensource and supported by community, what's the fundamental differences between PostgreSQL and those high-price commercial database (and some are bloated such as Oracle) from software giant such as Microsoft SQL Server, Oracle, and Sybase? Is PostgreSQL reliable enough to be used for high-end commercial application? Thanks
51
4507
by: jacob navia | last post by:
I would like to add at the beginning of the C tutorial I am writing a short blurb about what "types" are. I came up with the following text. Please can you comment? Did I miss something? Is there something wrong in there? -------------------------------------------------------------------- Types A type is a definition for a sequence of storage bits. It gives the meaning of the data stored in memory. If we say that the object a is an
17
3492
by: Anoob | last post by:
Can we consider () unary operator when calling a function, in exps eq. f(), ( 1 + 2). But when we call function f( 10 ) it is a binary operator. Even if we pass f( 10, 20) as we are using , operator there one operand will be there for ()? And Unary operators like !, +, -, ~, ... are said to be having associativity right to left which means that we can write, (but not allowed) 1. 2! 2. !2
3
11976
by: ArtPedUK | last post by:
I'm new on C# and I would like to know what it means and if it is necessary. decimal balances = new decimal; decimal ttl = 0m; What does 0m, means is necessary for the programman that "m", what does it means????????
13
5035
by: Jason Huang | last post by:
Hi, Would someone explain the following coding more detail for me? What's the ( ) for? CurrentText = (TextBox)e.Item.Cells.Controls; Thanks. Jason
4
3059
by: **Developer** | last post by:
Using Shell32.FolderItem's IsBrowsable I find, for example, that Internet Explorer and Printers and Faxes are browsable. I studied Help to find the definition of Browsable but could not find it. Can you tell me what Browserable means? Thanks in advance
4
3300
by: Ryan Liu | last post by:
TcpClient has a method called GetworkStream GetStream(); So in other words, there is only one stream associate with it for input and output, right? So while it is receiving, it can not send, and vise visa, right? So will it be a problem both server and client can initiative a sending action? TcpClient only supports synchronous operation. What does "Synchronous" mean? Means while it is reading or waiting for data to arrive from the...
669
25857
by: Xah Lee | last post by:
in March, i posted a essay “What is Expressiveness in a Computer Language”, archived at: http://xahlee.org/perl-python/what_is_expresiveness.html I was informed then that there is a academic paper written on this subject. On the Expressive Power of Programming Languages, by Matthias Felleisen, 1990. http://www.ccs.neu.edu/home/cobbe/pl-seminar-jr/notes/2003-sep-26/expressive-slides.pdf
10
2102
by: Franky | last post by:
I think I misread a post and understood that if I do: System.Windows.Forms.Cursor.Current = Cursors.WaitCursor there is no need to reset the cursor to Default. So I made all the reset statements into comments (placed an ' in front)
5
1581
by: thermate | last post by:
Dr.Bricmont, We are extremely proud of you for your brilliant analysis and courage to come out and say it. Your article brings out not one but several key concepts, worth close reading. The physicists like myself are proud to have one among us like you who seems to have an acute sense of humanitarianism .... ================= January 31, 2007 Resistance to Imperialism What is the Decisive "Clash" of Our Time?
0
8290
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8707
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8482
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8593
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6161
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5622
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4294
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2714
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1916
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.