adding elements to an array...

F

Frances

how to do you add elements to an array? am looking at section dealing
with arrays in JS Bible, can't find how you add to an array.. in the
last few years I've been doing much more Java than JS, am used to Java,
where you can't add elements to an array, but use a Vector instead.. and
it's very easy to add to it (use add() method..) how to you add
elements to an array in JavaScript..

I looked up array obj, don't see method to add to array...

thank you..
 
M

Michael Winter

On 30/05/2006 20:59, Vic Sowers wrote:

[snip]
a[-1] = "Zero";
a["Zero"] = -1;

Neither of these will be array elements.

What constitutes an array index has been described several times (both
by myself and others).

See, for example:

Author: Michael Winter
Date: 2004-12-07 10:26:36
Message-ID: opsimviozvx13kvk@atlantis

<http://groups.google.co.uk/group/comp.lang.javascript/msg/a7bf8971b33f971e>

in the thread, "Roundup of FAQ change requests".

Mike
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,479
Members
44,900
Latest member
Nell636132

Latest Threads

Top