English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

4 answers

I define a multi level array as follows. You can see it at my website: http://www.dcsi.net/~denmarks/amtrak_main.html


var Trains = [
["Acela Express",
[2100,2103,2104,2107,2109,2110,2117,2121,2122,2124,2125,2126,2150,2151,2153,2155,2158,2159,2163,2164,2166,2167,2168,2170,2171,2172,2175,2203,2205,2207,2208,2211,2212,2213,2216,2220,2221,2222,2225,2228,2250,2251,2252,2253,2254,2255,2256,2257,2259,2290],
["BOS","BBY","RTE","PVD","NLC","NHV","STM","NYP","NWK","MET","PHL","WIL","BAL","WAS"]],
["Adirondack",
[68,69,70,71],
["MTR","SLQ","RSP","PLB","PRK","WSP","POH","FTC","WHL","FED","SAR","SDY","ALB","HUD","RHI","POU","CRT","YNY","NYP"]],
......

2006-09-23 08:51:40 · answer #1 · answered by Barkley Hound 7 · 0 0

This will define an array of strings:

myArray = new Array('hello', 'world!');

And to test it:

document.writeln(myArray[0]);
document.writeln(myArray[1]);

2006-09-22 19:53:15 · answer #2 · answered by John T 3 · 0 0

Sure, try this:

myArray = [];

myArray is now defined. But you'll still need to add items, like so:

myArray[0] = "foo";

2006-09-22 19:31:53 · answer #3 · answered by Kent Brewster 3 · 0 0

Hey,


I'm not sure, but look here to see if you can find what you need.

http://devguru.com/technologies/javascript/10545.asp

2006-09-22 19:38:19 · answer #4 · answered by JTTech 3 · 0 0

fedest.com, questions and answers