aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes 'mulit-dimensional' arrays in javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark " Watch " New topic
Author

'mulit-dimensional' arrays in javascript

Justin Fox
Ranch Hand

Joined: Jan 24, 2006
Posts: 802
I could've swore you can create 2d arrays in javascript literally.

something like so...



how do I make one literally?

thanks,

Justin Fox


You down with OOP? Yeah you know me!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60057
    
  65

Hint: [[],[],[]]


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Justin Fox
Ranch Hand

Joined: Jan 24, 2006
Posts: 802
yeah, I finally figured it out, I had the array coming back from the server in this format:



and in client side when in eval that text and loop through
it gave me this

a,b,c a,b,c a,b,c
a,b,c a,b,c a,b,c

But when I set it up in this format:



it looped through and printed it fine:

a b c
a b c
a b c

was weird, but I got it working.

Justin Fox
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: 'mulit-dimensional' arrays in javascript
 
Similar Threads
Better way of doing this?
Array object vs. an array
IE9 javascript undefined errors
Problems with arrays & for loops
How to write retrieved data into javascript Array?