File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

multivalue javascript variable

 
pooja jain
greenhorn
Ranch Hand
Posts: 213
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to represent a multivalue variable?

for example, a 'box' which has three properties (attribute): id, weight and color.

should i go for array?

var box = new array();
box.id = 1;
box.weight = 10;
box.color = red;

or any other better way to achieve this?

thanks in advance.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should be using an object and not an array



You can also declare it like this



Do a search for JSON to get more information.

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic